diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts index 4b44a16365a..c2aae0617d5 100644 --- a/lib/lib.es2015.iterable.d.ts +++ b/lib/lib.es2015.iterable.d.ts @@ -223,7 +223,7 @@ interface PromiseConstructor { * @param values An iterable of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise<(awaited T)[]>; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -231,7 +231,15 @@ interface PromiseConstructor { * @param values An iterable of Promises. * @returns A new Promise. */ - race(values: Iterable>): Promise; + race(values: Iterable): Promise ? U : T>; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An iterable of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; } declare namespace Reflect { diff --git a/lib/lib.es2015.promise.d.ts b/lib/lib.es2015.promise.d.ts index 85a1a90768d..68dcd8cfe77 100644 --- a/lib/lib.es2015.promise.d.ts +++ b/lib/lib.es2015.promise.d.ts @@ -30,7 +30,7 @@ interface PromiseConstructor { * a resolve callback used to resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -38,7 +38,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9, awaited T10]>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -46,63 +46,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8, awaited T9]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7, awaited T8]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6, awaited T7]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5, awaited T6]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4, awaited T5]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3, awaited T4]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[awaited T1, awaited T2, awaited T3]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[awaited T1, awaited T2]>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -110,7 +54,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: T): Promise<{ -readonly [P in keyof T]: awaited T[P] }>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -118,10 +62,58 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: readonly (T | PromiseLike)[]): Promise<(awaited T)[]>; + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly (T | PromiseLike)[]): Promise; // see: lib.es2015.iterable.d.ts - // all(values: Iterable>): Promise<(awaited T)[]>; + // all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -129,24 +121,24 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: readonly (T | PromiseLike)[]): Promise; + race(values: readonly T[]): Promise ? U : T>; // see: lib.es2015.iterable.d.ts - // race(values: Iterable>): Promise; + // race(values: Iterable): Promise ? U : T>; /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. * @returns A new rejected Promise. */ - reject(reason?: any): Promise; + reject(reason?: any): Promise; /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | PromiseLike): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise . diff --git a/lib/lib.es2018.promise.d.ts b/lib/lib.es2018.promise.d.ts index a745dd4b11b..1a95d7c87c0 100644 --- a/lib/lib.es2018.promise.d.ts +++ b/lib/lib.es2018.promise.d.ts @@ -28,5 +28,5 @@ interface Promise { * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). * @returns A Promise for the completion of the callback. */ - finally(onfinally?: (() => void | PromiseLike) | undefined | null): Promise + finally(onfinally?: (() => void) | undefined | null): Promise } diff --git a/lib/lib.es2020.promise.d.ts b/lib/lib.es2020.promise.d.ts index b04fdf8b31c..a3b2c0aa88a 100644 --- a/lib/lib.es2020.promise.d.ts +++ b/lib/lib.es2020.promise.d.ts @@ -37,7 +37,8 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - allSettled(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult }>; + allSettled(values: T): + Promise<{ -readonly [P in keyof T]: PromiseSettledResult ? U : T[P]> }>; /** * Creates a Promise that is resolved with an array of results when all @@ -45,5 +46,5 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - allSettled(values: Iterable>): Promise[]>; + allSettled(values: Iterable): Promise ? U : T>[]>; } diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index 5e308b88314..65c0c012fe7 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1398,7 +1398,7 @@ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike | awaited T) => void, reject: (reason?: any) => void) => void) => PromiseLike; +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { /** @@ -1407,7 +1407,7 @@ interface PromiseLike { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; } /** @@ -1420,14 +1420,14 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; } interface ArrayLike { diff --git a/lib/lib.esnext.promise.d.ts b/lib/lib.esnext.promise.d.ts index 85d2c6d3c5c..6a56c551288 100644 --- a/lib/lib.esnext.promise.d.ts +++ b/lib/lib.esnext.promise.d.ts @@ -39,5 +39,5 @@ interface PromiseConstructor { * @param values An array or iterable of Promises. * @returns A new Promise. */ - any(values: (T | PromiseLike)[] | Iterable>): Promise + any(values: (T | PromiseLike)[] | Iterable>): Promise } diff --git a/lib/tsc.js b/lib/tsc.js index 8cd0ea5b3c4..4c1378aa7cb 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -5555,8 +5555,8 @@ var ts; any: 125, as: 123, asserts: 124, - bigint: 152, - boolean: 129, + bigint: 151, + boolean: 128, break: 77, case: 78, catch: 79, @@ -5564,9 +5564,9 @@ var ts; continue: 82, const: 81 }, - _a["" + "constructor"] = 130, + _a["" + "constructor"] = 129, _a.debugger = 83, - _a.declare = 131, + _a.declare = 130, _a.default = 84, _a.delete = 85, _a.do = 86, @@ -5577,49 +5577,49 @@ var ts; _a.false = 91, _a.finally = 92, _a.for = 93, - _a.from = 150, + _a.from = 149, _a.function = 94, - _a.get = 132, + _a.get = 131, _a.if = 95, _a.implements = 113, _a.import = 96, _a.in = 97, - _a.infer = 133, + _a.infer = 132, _a.instanceof = 98, _a.interface = 114, - _a.is = 134, - _a.keyof = 135, + _a.is = 133, + _a.keyof = 134, _a.let = 115, - _a.module = 136, - _a.namespace = 137, - _a.never = 138, + _a.module = 135, + _a.namespace = 136, + _a.never = 137, _a.new = 99, _a.null = 100, - _a.number = 141, - _a.object = 142, + _a.number = 140, + _a.object = 141, _a.package = 116, _a.private = 117, _a.protected = 118, _a.public = 119, - _a.readonly = 139, - _a.require = 140, - _a.global = 151, + _a.readonly = 138, + _a.require = 139, + _a.global = 150, _a.return = 101, - _a.set = 143, + _a.set = 142, _a.static = 120, - _a.string = 144, + _a.string = 143, _a.super = 102, _a.switch = 103, - _a.symbol = 145, + _a.symbol = 144, _a.this = 104, _a.throw = 105, _a.true = 106, _a.try = 107, - _a.type = 146, + _a.type = 145, _a.typeof = 108, - _a.undefined = 147, - _a.unique = 148, - _a.unknown = 149, + _a.undefined = 146, + _a.unique = 147, + _a.unknown = 148, _a.var = 109, _a.void = 110, _a.while = 111, @@ -5627,8 +5627,7 @@ var ts; _a.yield = 121, _a.async = 126, _a.await = 127, - _a.awaited = 128, - _a.of = 153, + _a.of = 152, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18, "}": 19, "(": 20, ")": 21, "[": 22, "]": 23, ".": 24, "...": 25, ";": 26, ",": 27, "<": 29, ">": 31, "<=": 32, ">=": 33, "==": 34, "!=": 35, "===": 36, "!==": 37, "=>": 38, "+": 39, "-": 40, "**": 42, "*": 41, "/": 43, "%": 44, "++": 45, "--": 46, "<<": 47, ">": 48, ">>>": 49, "&": 50, "|": 51, "^": 52, "!": 53, "~": 54, "&&": 55, "||": 56, "?": 57, "??": 60, "?.": 28, ":": 58, "=": 62, "+=": 63, "-=": 64, "*=": 65, "**=": 66, "/=": 67, "%=": 68, "<<=": 69, ">>=": 70, ">>>=": 71, "&=": 72, "|=": 73, "^=": 74, "@": 59, "`": 61 })); @@ -7667,9 +7666,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156) { + if (d && d.kind === 155) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246) { return current; } } @@ -7677,7 +7676,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92) && parent.kind === 163; + return ts.hasModifier(node, 92) && parent.kind === 162; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -7707,14 +7706,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243) { + if (node.kind === 242) { node = node.parent; } - if (node && node.kind === 244) { + if (node && node.kind === 243) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226) { + if (node && node.kind === 225) { flags |= getFlags(node); } return flags; @@ -7828,30 +7827,30 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 226: + case 225: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227: + case 226: var expr = hostNode.expression; - if (expr.kind === 210 && expr.operatorToken.kind === 62) { + if (expr.kind === 209 && expr.operatorToken.kind === 62) { expr = expr.left; } switch (expr.kind) { - case 195: + case 194: return expr.name; - case 196: + case 195: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201: { + case 200: { return getDeclarationIdentifier(hostNode.expression); } - case 239: { + case 238: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -7885,16 +7884,16 @@ var ts; switch (declaration.kind) { case 75: return declaration; - case 324: - case 318: { + case 323: + case 317: { var name = declaration.name; - if (name.kind === 154) { + if (name.kind === 153) { return name.right; } break; } - case 197: - case 210: { + case 196: + case 209: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1: @@ -7910,15 +7909,15 @@ var ts; return undefined; } } - case 323: + case 322: return getNameOfJSDocTypedef(declaration); - case 317: + case 316: return nameForNamelessJSDocTypedef(declaration); - case 260: { + case 259: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196: + case 195: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -8086,7 +8085,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304); + ts.Debug.assert(node.parent.kind === 303); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -8152,11 +8151,11 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 154; + return node.kind === 153; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155; + return node.kind === 154; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -8168,159 +8167,159 @@ var ts; } ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; function isTypeParameterDeclaration(node) { - return node.kind === 156; + return node.kind === 155; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157; + return node.kind === 156; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158; + return node.kind === 157; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 159; + return node.kind === 158; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160; + return node.kind === 159; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161; + return node.kind === 160; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162; + return node.kind === 161; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163; + return node.kind === 162; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164; + return node.kind === 163; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165; + return node.kind === 164; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166; + return node.kind === 165; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167; + return node.kind === 166; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168; + return node.kind === 167; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 || node.kind === 164; + return node.kind === 164 || node.kind === 163; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isTypePredicateNode(node) { - return node.kind === 169; + return node.kind === 168; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170; + return node.kind === 169; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171; + return node.kind === 170; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172; + return node.kind === 171; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173; + return node.kind === 172; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174; + return node.kind === 173; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175; + return node.kind === 174; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176; + return node.kind === 175; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179; + return node.kind === 178; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180; + return node.kind === 179; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181; + return node.kind === 180; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182; + return node.kind === 181; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183; + return node.kind === 182; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184; + return node.kind === 183; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185; + return node.kind === 184; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186; + return node.kind === 185; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187; + return node.kind === 186; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188; + return node.kind === 187; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189; + return node.kind === 188; } ts.isImportTypeNode = isImportTypeNode; function isObjectBindingPattern(node) { - return node.kind === 190; + return node.kind === 189; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191; + return node.kind === 190; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192; + return node.kind === 191; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 193; + return node.kind === 192; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194; + return node.kind === 193; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195; + return node.kind === 194; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -8328,7 +8327,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196; + return node.kind === 195; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -8336,7 +8335,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197; + return node.kind === 196; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -8346,13 +8345,14 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32) && - (kind === 195 + (kind === 194 + || kind === 195 || kind === 196 - || kind === 197); + || kind === 218); } ts.isOptionalChain = isOptionalChain; function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; function isExpressionOfOptionalChainRoot(node) { @@ -8366,19 +8366,19 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 && node.operatorToken.kind === 60; + return node.kind === 209 && node.operatorToken.kind === 60; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198; + return node.kind === 197; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199; + return node.kind === 198; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200; + return node.kind === 199; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -8387,376 +8387,377 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201; + return node.kind === 200; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202; + return node.kind === 201; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203; + return node.kind === 202; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204; + return node.kind === 203; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205; + return node.kind === 204; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206; + return node.kind === 205; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207; + return node.kind === 206; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208; + return node.kind === 207; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209; + return node.kind === 208; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210; + return node.kind === 209; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211; + return node.kind === 210; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212; + return node.kind === 211; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213; + return node.kind === 212; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214; + return node.kind === 213; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215; + return node.kind === 214; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216; + return node.kind === 215; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217; + return node.kind === 216; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218; + return node.kind === 217; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219; + return node.kind === 218; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220; + return node.kind === 219; } ts.isMetaProperty = isMetaProperty; function isTemplateSpan(node) { - return node.kind === 222; + return node.kind === 221; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223; + return node.kind === 222; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 224; + return node.kind === 223; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226; + return node.kind === 225; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225; + return node.kind === 224; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227; + return node.kind === 226; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228; + return node.kind === 227; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229; + return node.kind === 228; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230; + return node.kind === 229; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231; + return node.kind === 230; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232; + return node.kind === 231; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233; + return node.kind === 232; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234; + return node.kind === 233; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235; + return node.kind === 234; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 || node.kind === 234; + return node.kind === 234 || node.kind === 233; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236; + return node.kind === 235; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237; + return node.kind === 236; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238; + return node.kind === 237; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239; + return node.kind === 238; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240; + return node.kind === 239; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241; + return node.kind === 240; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242; + return node.kind === 241; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243; + return node.kind === 242; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244; + return node.kind === 243; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245; + return node.kind === 244; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246; + return node.kind === 245; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247; + return node.kind === 246; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248; + return node.kind === 247; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249; + return node.kind === 248; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250; + return node.kind === 249; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251; + return node.kind === 250; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252; + return node.kind === 251; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253; + return node.kind === 252; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254; + return node.kind === 253; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255; + return node.kind === 254; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256; + return node.kind === 255; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257; + return node.kind === 256; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263; + return node.kind === 262; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 || node.kind === 262; + return node.kind === 262 || node.kind === 261; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258; + return node.kind === 257; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259; + return node.kind === 258; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260; + return node.kind === 259; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261; + return node.kind === 260; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262; + return node.kind === 261; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264; + return node.kind === 263; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265; + return node.kind === 264; } ts.isMissingDeclaration = isMissingDeclaration; function isExternalModuleReference(node) { - return node.kind === 266; + return node.kind === 265; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 267; + return node.kind === 266; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268; + return node.kind === 267; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269; + return node.kind === 268; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270; + return node.kind === 269; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271; + return node.kind === 270; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272; + return node.kind === 271; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273; + return node.kind === 272; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274; + return node.kind === 273; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275; + return node.kind === 274; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276; + return node.kind === 275; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277; + return node.kind === 276; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 278; + return node.kind === 277; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279; + return node.kind === 278; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280; + return node.kind === 279; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281; + return node.kind === 280; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 282; + return node.kind === 281; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283; + return node.kind === 282; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284; + return node.kind === 283; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 285; + return node.kind === 284; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 291; + return node.kind === 290; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292; + return node.kind === 291; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293; + return node.kind === 292; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287; + return node.kind === 286; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { + case 287: case 288: - case 289: return true; default: return false; @@ -8765,128 +8766,128 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 || - node.kind === 290; + node.kind === 285 || + node.kind === 289; } ts.isUnparsedNode = isUnparsedNode; function isJSDocTypeExpression(node) { - return node.kind === 295; + return node.kind === 294; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296; + return node.kind === 295; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297; + return node.kind === 296; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298; + return node.kind === 297; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299; + return node.kind === 298; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300; + return node.kind === 299; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301; + return node.kind === 300; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302; + return node.kind === 301; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304; + return node.kind === 303; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310; + return node.kind === 309; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308; + return node.kind === 307; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309; + return node.kind === 308; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311; + return node.kind === 310; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312; + return node.kind === 311; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313; + return node.kind === 312; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314; + return node.kind === 313; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315; + return node.kind === 314; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317; + return node.kind === 316; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320; + return node.kind === 319; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318; + return node.kind === 317; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319; + return node.kind === 318; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321; + return node.kind === 320; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322; + return node.kind === 321; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323; + return node.kind === 322; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324; + return node.kind === 323; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 || node.kind === 318; + return node.kind === 323 || node.kind === 317; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305; + return node.kind === 304; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316; + return node.kind === 315; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306; + return node.kind === 305; } ts.isJSDocSignature = isJSDocSignature; function isSyntaxList(n) { - return n.kind === 325; + return n.kind === 324; } ts.isSyntaxList = isSyntaxList; function isNode(node) { @@ -8894,11 +8895,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 154; + return kind >= 153; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 153; + return n.kind >= 0 && n.kind <= 152; } ts.isToken = isToken; function isNodeArray(array) { @@ -8933,12 +8934,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259: - case 264: + case 258: + case 263: return node.parent.parent.isTypeOnly; - case 257: - return node.parent.isTypeOnly; case 256: + return node.parent.isTypeOnly; + case 255: return node.isTypeOnly; default: return false; @@ -8966,13 +8967,13 @@ var ts; case 122: case 126: case 81: - case 131: + case 130: case 84: case 89: case 119: case 117: case 118: - case 139: + case 138: case 120: return true; } @@ -8993,7 +8994,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 + return kind === 153 || kind === 75; } ts.isEntityName = isEntityName; @@ -9003,14 +9004,14 @@ var ts; || kind === 76 || kind === 10 || kind === 8 - || kind === 155; + || kind === 154; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 - || kind === 190 - || kind === 191; + || kind === 189 + || kind === 190; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -9023,13 +9024,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245: + case 244: + case 161: case 162: case 163: case 164: - case 165: + case 201: case 202: - case 203: return true; default: return false; @@ -9037,14 +9038,14 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 161: + case 160: + case 165: + case 305: case 166: - case 306: case 167: - case 168: + case 170: + case 300: case 171: - case 301: - case 172: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -9057,28 +9058,28 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 163 - || kind === 160 - || kind === 162 + return kind === 162 + || kind === 159 + || kind === 161 + || kind === 163 || kind === 164 - || kind === 165 - || kind === 168 - || kind === 223; + || kind === 167 + || kind === 222; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 || node.kind === 215); + return node && (node.kind === 245 || node.kind === 214); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 || node.kind === 165); + return node && (node.kind === 163 || node.kind === 164); } ts.isAccessor = isAccessor; function isMethodOrAccessor(node) { switch (node.kind) { - case 162: + case 161: + case 163: case 164: - case 165: return true; default: return false; @@ -9087,11 +9088,11 @@ var ts; ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 167 - || kind === 166 - || kind === 159 - || kind === 161 - || kind === 168; + return kind === 166 + || kind === 165 + || kind === 158 + || kind === 160 + || kind === 167; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -9100,12 +9101,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 + return kind === 281 + || kind === 282 || kind === 283 - || kind === 284 - || kind === 162 - || kind === 164 - || kind === 165; + || kind === 161 + || kind === 163 + || kind === 164; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNode(node) { @@ -9114,8 +9115,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { + case 170: case 171: - case 172: return true; } return false; @@ -9124,29 +9125,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 - || kind === 190; + return kind === 190 + || kind === 189; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 - || kind === 194; + return kind === 192 + || kind === 193; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 - || kind === 216; + return kind === 191 + || kind === 215; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243: - case 157: - case 192: + case 242: + case 156: + case 191: return true; } return false; @@ -9159,8 +9160,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190: - case 194: + case 189: + case 193: return true; } return false; @@ -9168,8 +9169,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191: - case 193: + case 190: + case 192: return true; } return false; @@ -9177,25 +9178,25 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 - || kind === 154 - || kind === 189; + return kind === 194 + || kind === 153 + || kind === 188; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 - || kind === 154; + return kind === 194 + || kind === 153; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269: case 268: + case 267: + case 196: case 197: case 198: - case 199: - case 158: + case 157: return true; default: return false; @@ -9203,12 +9204,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 || node.kind === 198; + return node.kind === 196 || node.kind === 197; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 + return kind === 211 || kind === 14; } ts.isTemplateLiteral = isTemplateLiteral; @@ -9218,33 +9219,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195: - case 196: - case 198: - case 197: - case 267: - case 268: - case 271: - case 199: - case 193: - case 201: case 194: - case 215: - case 202: + case 195: + case 197: + case 196: + case 266: + case 267: + case 270: + case 198: + case 192: + case 200: + case 193: + case 214: + case 201: case 75: case 13: case 8: case 9: case 10: case 14: - case 212: + case 211: case 91: case 100: case 104: case 106: case 102: + case 218: case 219: - case 220: case 96: return true; default: @@ -9257,13 +9258,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { + case 207: case 208: - case 209: + case 203: case 204: case 205: case 206: - case 207: - case 200: + case 199: return true; default: return isLeftHandSideExpressionKind(kind); @@ -9271,9 +9272,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209: - return true; case 208: + return true; + case 207: return expr.operator === 45 || expr.operator === 46; default: @@ -9287,15 +9288,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211: - case 213: - case 203: case 210: - case 214: - case 218: - case 216: - case 328: + case 212: + case 202: + case 209: + case 213: + case 217: + case 215: case 327: + case 326: return true; default: return isUnaryExpressionKind(kind); @@ -9303,20 +9304,20 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 - || kind === 218; + return kind === 199 + || kind === 217; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 327; + return node.kind === 326; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 326; + return node.kind === 325; } ts.isNotEmittedStatement = isNotEmittedStatement; function isSyntheticReference(node) { - return node.kind === 331; + return node.kind === 330; } ts.isSyntheticReference = isSyntheticReference; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -9326,13 +9327,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { + case 230: case 231: case 232: - case 233: + case 228: case 229: - case 230: return true; - case 239: + case 238: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -9355,7 +9356,7 @@ var ts; } ts.isExternalModuleIndicator = isExternalModuleIndicator; function isForInOrOfStatement(node) { - return node.kind === 232 || node.kind === 233; + return node.kind === 231 || node.kind === 232; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -9374,109 +9375,109 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 251 - || kind === 250 + return kind === 250 + || kind === 249 || kind === 75; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 - || kind === 250; + return kind === 250 + || kind === 249; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 - || kind === 250; + || kind === 249; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 - || kind === 257; + return kind === 257 + || kind === 256; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 250 || node.kind === 249; + return node.kind === 249 || node.kind === 248; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 - || kind === 192 - || kind === 246 - || kind === 215 - || kind === 163 - || kind === 249 - || kind === 285 - || kind === 264 + return kind === 202 + || kind === 191 || kind === 245 - || kind === 202 - || kind === 164 - || kind === 256 - || kind === 254 - || kind === 259 - || kind === 247 - || kind === 274 + || kind === 214 || kind === 162 - || kind === 161 - || kind === 250 - || kind === 253 - || kind === 257 - || kind === 263 - || kind === 157 - || kind === 282 - || kind === 160 - || kind === 159 - || kind === 165 - || kind === 283 || kind === 248 + || kind === 284 + || kind === 263 + || kind === 244 + || kind === 201 + || kind === 163 + || kind === 255 + || kind === 253 + || kind === 258 + || kind === 246 + || kind === 273 + || kind === 161 + || kind === 160 + || kind === 249 + || kind === 252 + || kind === 256 + || kind === 262 || kind === 156 - || kind === 243 - || kind === 323 - || kind === 316 - || kind === 324; + || kind === 281 + || kind === 159 + || kind === 158 + || kind === 164 + || kind === 282 + || kind === 247 + || kind === 155 + || kind === 242 + || kind === 322 + || kind === 315 + || kind === 323; } function isDeclarationStatementKind(kind) { - return kind === 245 - || kind === 265 + return kind === 244 + || kind === 264 + || kind === 245 || kind === 246 || kind === 247 || kind === 248 || kind === 249 - || kind === 250 - || kind === 255 || kind === 254 - || kind === 261 + || kind === 253 || kind === 260 - || kind === 253; + || kind === 259 + || kind === 252; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 - || kind === 234 - || kind === 242 - || kind === 229 - || kind === 227 - || kind === 225 - || kind === 232 + return kind === 234 || kind === 233 - || kind === 231 - || kind === 228 - || kind === 239 - || kind === 236 - || kind === 238 - || kind === 240 || kind === 241 + || kind === 228 || kind === 226 + || kind === 224 + || kind === 231 + || kind === 232 || kind === 230 + || kind === 227 + || kind === 238 + || kind === 235 || kind === 237 - || kind === 326 - || kind === 330 - || kind === 329; + || kind === 239 + || kind === 240 + || kind === 225 + || kind === 229 + || kind === 236 + || kind === 325 + || kind === 329 + || kind === 328; } function isDeclaration(node) { - if (node.kind === 156) { - return (node.parent && node.parent.kind !== 322) || ts.isInJSFile(node); + if (node.kind === 155) { + return (node.parent && node.parent.kind !== 321) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -9497,10 +9498,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224) + if (node.kind !== 223) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 || node.parent.kind === 281) { + if (node.parent.kind === 240 || node.parent.kind === 280) { return false; } } @@ -9508,8 +9509,8 @@ var ts; } function isModuleReference(node) { var kind = node.kind; - return kind === 266 - || kind === 154 + return kind === 265 + || kind === 153 || kind === 75; } ts.isModuleReference = isModuleReference; @@ -9517,60 +9518,60 @@ var ts; var kind = node.kind; return kind === 104 || kind === 75 - || kind === 195; + || kind === 194; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 267 - || kind === 277 - || kind === 268 + return kind === 266 + || kind === 276 + || kind === 267 || kind === 11 - || kind === 271; + || kind === 270; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 - || kind === 276; + return kind === 273 + || kind === 275; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 - || kind === 277; + || kind === 276; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 - || kind === 268; + return kind === 268 + || kind === 267; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 - || kind === 279; + return kind === 277 + || kind === 278; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 295 && node.kind <= 324; + return node.kind >= 294 && node.kind <= 323; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 304 || node.kind === 303 || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 || node.kind === 302 || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 307 && node.kind <= 324; + return node.kind >= 306 && node.kind <= 323; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165; + return node.kind === 164; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164; + return node.kind === 163; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { @@ -9588,13 +9589,13 @@ var ts; ts.hasInitializer = hasInitializer; function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243: - case 157: - case 192: + case 242: + case 156: + case 191: + case 158: case 159: - case 160: - case 282: - case 285: + case 281: + case 284: return true; default: return false; @@ -9602,11 +9603,11 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 || node.kind === 276 || isObjectLiteralElementLike(node); + return node.kind === 273 || node.kind === 275 || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; function isTypeReferenceType(node) { - return node.kind === 170 || node.kind === 217; + return node.kind === 169 || node.kind === 216; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -9887,7 +9888,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291) { + while (node && node.kind !== 290) { node = node.parent; } return node; @@ -9895,11 +9896,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224: - case 252: + case 223: + case 251: + case 230: case 231: case 232: - case 233: return true; } return false; @@ -10049,7 +10050,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 325 && node._children.length > 0) { + if (node.kind === 324 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -10158,7 +10159,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 && node.parent.kind === 281; + return node.kind === 242 && node.parent.kind === 280; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -10182,11 +10183,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 250 && (!node.body); + return node && node.kind === 249 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 || - node.kind === 250 || + return node.kind === 290 || + node.kind === 249 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -10200,9 +10201,9 @@ var ts; ts.isExternalModuleAugmentation = isExternalModuleAugmentation; function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 291: + case 290: return ts.isExternalModule(node.parent); - case 251: + case 250: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -10246,22 +10247,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291: - case 252: - case 281: - case 250: + case 290: + case 251: + case 280: + case 249: + case 230: case 231: case 232: - case 233: - case 163: case 162: + case 161: + case 163: case 164: - case 165: - case 245: + case 244: + case 201: case 202: - case 203: return true; - case 224: + case 223: return !ts.isFunctionLike(parentNode); } return false; @@ -10269,9 +10270,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316: - case 323: - case 306: + case 315: + case 322: + case 305: return true; default: ts.assertType(node); @@ -10281,25 +10282,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { + case 165: case 166: + case 160: case 167: - case 161: - case 168: + case 170: case 171: - case 172: - case 301: - case 246: - case 215: - case 247: - case 248: - case 322: + case 300: case 245: + case 214: + case 246: + case 247: + case 321: + case 244: + case 161: case 162: case 163: case 164: - case 165: + case 201: case 202: - case 203: return true; default: ts.assertType(node); @@ -10309,8 +10310,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255: case 254: + case 253: return true; default: return false; @@ -10319,15 +10320,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255: case 254: - case 226: - case 246: + case 253: + case 225: case 245: - case 250: - case 248: - case 247: + case 244: case 249: + case 247: + case 246: + case 248: return true; default: return false; @@ -10359,7 +10360,7 @@ var ts; case 8: case 14: return ts.escapeLeadingUnderscores(name.text); - case 155: + case 154: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -10375,9 +10376,9 @@ var ts; case 76: case 75: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154: + case 153: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195: + case 194: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -10438,7 +10439,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224) { + if (node.body && node.body.kind === 223) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -10450,34 +10451,34 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291: + case 290: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 243: - case 192: - case 246: - case 215: - case 247: - case 250: - case 249: - case 285: + case 242: + case 191: case 245: - case 202: - case 162: - case 164: - case 165: + case 214: + case 246: + case 249: case 248: - case 160: + case 284: + case 244: + case 201: + case 161: + case 163: + case 164: + case 247: case 159: + case 158: errorNode = node.name; break; - case 203: + case 202: return getErrorSpanForArrowFunction(sourceFile, node); + case 277: case 278: - case 279: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -10526,11 +10527,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 && n.expression.kind === 102; + return n.kind === 196 && n.expression.kind === 102; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 && n.expression.kind === 96; + return n.kind === 196 && n.expression.kind === 96; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -10544,7 +10545,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 + return node.kind === 226 && node.expression.kind === 10; } ts.isPrologueDirective = isPrologueDirective; @@ -10553,11 +10554,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 || - node.kind === 156 || + var commentRanges = (node.kind === 156 || + node.kind === 155 || + node.kind === 201 || node.kind === 202 || - node.kind === 203 || - node.kind === 201) ? + node.kind === 200) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -10572,79 +10573,79 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 <= node.kind && node.kind <= 189) { + if (168 <= node.kind && node.kind <= 188) { return true; } switch (node.kind) { case 125: - case 149: - case 141: - case 152: + case 148: + case 140: + case 151: + case 143: + case 128: case 144: - case 129: - case 145: - case 142: - case 147: - case 138: + case 141: + case 146: + case 137: return true; case 110: - return node.parent.kind !== 206; - case 217: + return node.parent.kind !== 205; + case 216: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156: - return node.parent.kind === 187 || node.parent.kind === 182; + case 155: + return node.parent.kind === 186 || node.parent.kind === 181; case 75: - if (node.parent.kind === 154 && node.parent.right === node) { + if (node.parent.kind === 153 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 && node.parent.name === node) { + else if (node.parent.kind === 194 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 75 || node.kind === 154 || node.kind === 195, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 154: - case 195: + ts.Debug.assert(node.kind === 75 || node.kind === 153 || node.kind === 194, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 153: + case 194: case 104: { var parent = node.parent; - if (parent.kind === 173) { + if (parent.kind === 172) { return false; } - if (parent.kind === 189) { + if (parent.kind === 188) { return !parent.isTypeOf; } - if (169 <= parent.kind && parent.kind <= 189) { + if (168 <= parent.kind && parent.kind <= 188) { return true; } switch (parent.kind) { - case 217: + case 216: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156: + case 155: return node === parent.constraint; - case 322: + case 321: return node === parent.constraint; - case 160: case 159: - case 157: - case 243: + case 158: + case 156: + case 242: return node === parent.type; - case 245: + case 244: + case 201: case 202: - case 203: - case 163: case 162: case 161: + case 160: + case 163: case 164: - case 165: return node === parent.type; + case 165: case 166: case 167: - case 168: return node === parent.type; - case 200: - return node === parent.type; - case 197: - case 198: - return ts.contains(parent.typeArguments, node); case 199: + return node === parent.type; + case 196: + case 197: + return ts.contains(parent.typeArguments, node); + case 198: return false; } } @@ -10666,23 +10667,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236: + case 235: return visitor(node); - case 252: - case 224: + case 251: + case 223: + case 227: case 228: case 229: case 230: case 231: case 232: - case 233: + case 236: case 237: - case 238: + case 277: case 278: - case 279: - case 239: - case 241: - case 281: + case 238: + case 240: + case 280: return ts.forEachChild(node, traverse); } } @@ -10692,21 +10693,21 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213: + case 212: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; + case 248: + case 246: case 249: case 247: - case 250: - case 248: return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155) { + if (node.name && node.name.kind === 154) { traverse(node.name.expression); return; } @@ -10719,10 +10720,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 175) { + if (node && node.kind === 174) { return node.elementType; } - else if (node && node.kind === 170) { + else if (node && node.kind === 169) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -10732,12 +10733,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247: case 246: - case 215: - case 174: + case 245: + case 214: + case 173: return node.members; - case 194: + case 193: return node.properties; } } @@ -10745,14 +10746,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192: - case 285: - case 157: - case 282: - case 160: + case 191: + case 284: + case 156: + case 281: case 159: - case 283: - case 243: + case 158: + case 282: + case 242: return true; } } @@ -10764,8 +10765,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 - && node.parent.parent.kind === 226; + return node.parent.kind === 243 + && node.parent.parent.kind === 225; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -10776,13 +10777,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162: case 161: + case 160: + case 162: case 163: case 164: - case 165: - case 245: - case 202: + case 244: + case 201: return true; } return false; @@ -10793,7 +10794,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239) { + if (node.statement.kind !== 238) { return node.statement; } node = node.statement; @@ -10801,17 +10802,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 && ts.isFunctionLike(node.parent); + return node && node.kind === 223 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 && node.parent.kind === 194; + return node && node.kind === 161 && node.parent.kind === 193; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 && - (node.parent.kind === 194 || - node.parent.kind === 215); + return node.kind === 161 && + (node.parent.kind === 193 || + node.parent.kind === 214); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -10824,7 +10825,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282) { + if (property.kind === 281) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -10865,46 +10866,46 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291); + ts.Debug.assert(node.kind !== 290); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); } switch (node.kind) { - case 155: + case 154: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 158: - if (node.parent.kind === 157 && ts.isClassElement(node.parent.parent)) { + case 157: + if (node.parent.kind === 156 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 203: + case 202: if (!includeArrowFunctions) { continue; } - case 245: - case 202: - case 250: - case 160: + case 244: + case 201: + case 249: case 159: - case 162: + case 158: case 161: + case 160: + case 162: case 163: case 164: case 165: case 166: case 167: - case 168: - case 249: - case 291: + case 248: + case 290: return node; } } @@ -10914,9 +10915,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 163: - case 245: - case 202: + case 162: + case 244: + case 201: return container; } } @@ -10930,25 +10931,25 @@ var ts; return node; } switch (node.kind) { - case 155: + case 154: node = node.parent; break; - case 245: + case 244: + case 201: case 202: - case 203: if (!stopOnFunctions) { continue; } - case 160: case 159: - case 162: + case 158: case 161: + case 160: + case 162: case 163: case 164: - case 165: return node; - case 158: - if (node.parent.kind === 157 && ts.isClassElement(node.parent.parent)) { + case 157: + if (node.parent.kind === 156 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -10960,14 +10961,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 || func.kind === 203) { + if (func.kind === 201 || func.kind === 202) { var prev = func; var parent = func.parent; - while (parent.kind === 201) { + while (parent.kind === 200) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 && parent.expression === prev) { + if (parent.kind === 196 && parent.expression === prev) { return parent; } } @@ -10980,26 +10981,26 @@ var ts; ts.isSuperOrSuperProperty = isSuperOrSuperProperty; function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 || kind === 196) + return (kind === 194 || kind === 195) && node.expression.kind === 102; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 195 || kind === 196) + return (kind === 194 || kind === 195) && node.expression.kind === 104; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170: + case 169: return node.typeName; - case 217: + case 216: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75: - case 154: + case 153: return node; } return undefined; @@ -11007,10 +11008,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199: + case 198: return node.tag; - case 269: case 268: + case 267: return node.tagName; default: return node.expression; @@ -11022,21 +11023,21 @@ var ts; return false; } switch (node.kind) { - case 246: + case 245: return true; - case 160: - return parent.kind === 246; + case 159: + return parent.kind === 245; + case 163: case 164: - case 165: - case 162: + case 161: return node.body !== undefined - && parent.kind === 246; - case 157: + && parent.kind === 245; + case 156: return parent.body !== undefined - && (parent.kind === 163 - || parent.kind === 162 - || parent.kind === 165) - && grandparent.kind === 246; + && (parent.kind === 162 + || parent.kind === 161 + || parent.kind === 164) + && grandparent.kind === 245; } return false; } @@ -11052,10 +11053,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246: + case 245: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 162: - case 165: + case 161: + case 164: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); default: return false; @@ -11064,9 +11065,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 || - parent.kind === 268 || - parent.kind === 270) { + if (parent.kind === 268 || + parent.kind === 267 || + parent.kind === 269) { return parent.tagName === node; } return false; @@ -11079,44 +11080,44 @@ var ts; case 106: case 91: case 13: + case 192: case 193: case 194: case 195: case 196: case 197: case 198: + case 217: case 199: case 218: case 200: - case 219: case 201: + case 214: case 202: - case 215: - case 203: - case 206: - case 204: case 205: + case 203: + case 204: + case 207: case 208: case 209: case 210: - case 211: - case 214: - case 212: - case 216: - case 267: - case 268: - case 271: case 213: - case 207: - case 220: + case 211: + case 215: + case 266: + case 267: + case 270: + case 212: + case 206: + case 219: return true; - case 154: - while (node.parent.kind === 154) { + case 153: + while (node.parent.kind === 153) { node = node.parent; } - return node.parent.kind === 173 || isJSXTagName(node); + return node.parent.kind === 172 || isJSXTagName(node); case 75: - if (node.parent.kind === 173 || isJSXTagName(node)) { + if (node.parent.kind === 172 || isJSXTagName(node)) { return true; } case 8: @@ -11133,49 +11134,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243: - case 157: - case 160: + case 242: + case 156: case 159: - case 285: - case 282: - case 192: + case 158: + case 284: + case 281: + case 191: return parent.initializer === node; + case 226: case 227: case 228: case 229: - case 230: + case 235: case 236: case 237: - case 238: - case 278: - case 240: + case 277: + case 239: return parent.expression === node; - case 231: + case 230: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243) || forStatement.condition === node || forStatement.incrementor === node; + case 231: case 232: - case 233: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243) || forInStatement.expression === node; - case 200: - case 218: - return node === parent.expression; - case 222: - return node === parent.expression; - case 155: - return node === parent.expression; - case 158: - case 277: - case 276: - case 284: - return true; + case 199: case 217: - return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); + return node === parent.expression; + case 221: + return node === parent.expression; + case 154: + return node === parent.expression; + case 157: + case 276: + case 275: case 283: + return true; + case 216: + return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); + case 282: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -11183,14 +11184,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 || node.kind === 75) { + while (node.kind === 153 || node.kind === 75) { node = node.parent; } - return node.kind === 173; + return node.kind === 172; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 && node.moduleReference.kind === 266; + return node.kind === 253 && node.moduleReference.kind === 265; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -11199,7 +11200,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 && node.moduleReference.kind !== 266; + return node.kind === 253 && node.moduleReference.kind !== 265; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -11231,11 +11232,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 || node.typeArguments[0].kind === 141); + (node.typeArguments[0].kind === 143 || node.typeArguments[0].kind === 140); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197) { + if (callExpression.kind !== 196) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -11351,11 +11352,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 || e.kind === 203 ? initializer : undefined; + return e.kind === 201 || e.kind === 202 ? initializer : undefined; } - if (initializer.kind === 202 || - initializer.kind === 215 || - initializer.kind === 203) { + if (initializer.kind === 201 || + initializer.kind === 214 || + initializer.kind === 202) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -11567,7 +11568,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 && + expr.parent && expr.parent.kind === 226 && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -11577,7 +11578,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -11586,14 +11587,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255: - case 261: + case 254: + case 260: return node.parent; - case 266: + case 265: return node.parent.parent; - case 197: + case 196: return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : undefined; - case 188: + case 187: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -11603,12 +11604,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255: - case 261: - return node.moduleSpecifier; case 254: - return node.moduleReference.kind === 266 ? node.moduleReference.expression : undefined; - case 189: + case 260: + return node.moduleSpecifier; + case 253: + return node.moduleReference.kind === 265 ? node.moduleReference.expression : undefined; + case 188: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -11617,11 +11618,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255: - return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); case 254: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 253: return node; - case 261: + case 260: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -11629,7 +11630,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 && !!node.importClause && !!node.importClause.name; + return node.kind === 254 && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -11650,13 +11651,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157: - case 162: + case 156: case 161: - case 283: - case 282: case 160: + case 282: + case 281: case 159: + case 158: return node.questionToken !== undefined; } } @@ -11670,7 +11671,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 || node.kind === 316 || node.kind === 317; + return node.kind === 322 || node.kind === 315 || node.kind === 316; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -11695,12 +11696,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226: + case 225: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160: + case 159: return node.initializer; - case 282: + case 281: return node.initializer; } } @@ -11711,7 +11712,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 + node.body.kind === 249 ? node.body : undefined; } @@ -11725,11 +11726,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157) { + if (node.kind === 156) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156) { + if (node.kind === 155) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -11740,10 +11741,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 || - parent.kind === 260 || - parent.kind === 160 || - parent.kind === 227 && node.kind === 195 || + if (parent.kind === 281 || + parent.kind === 259 || + parent.kind === 159 || + parent.kind === 226 && node.kind === 194 || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62) { return parent; @@ -11809,7 +11810,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -11820,31 +11821,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210: + case 209: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 ? 1 : 2 : 0; + case 207: case 208: - case 209: var unaryOperator = parent.operator; return unaryOperator === 45 || unaryOperator === 46 ? 2 : 0; + case 231: case 232: - case 233: return parent.initializer === node ? 1 : 0; - case 201: - case 193: - case 214: - case 219: + case 200: + case 192: + case 213: + case 218: node = parent; break; - case 283: + case 282: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 282: + case 281: if (parent.name === node) { return 0; } @@ -11863,22 +11864,22 @@ var ts; ts.isAssignmentTarget = isAssignmentTarget; function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224: - case 226: + case 223: + case 225: + case 236: + case 227: case 237: - case 228: - case 238: - case 252: + case 251: + case 277: case 278: - case 279: - case 239: + case 238: + case 230: case 231: case 232: - case 233: + case 228: case 229: - case 230: - case 241: - case 281: + case 240: + case 280: return true; } return false; @@ -11895,32 +11896,29 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183); + return walkUp(node, 182); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201); + return walkUp(node, 200); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201) { + while (node.kind === 200) { node = node.parent; } return node; } function isDeleteTarget(node) { - if (node.kind !== 195 && node.kind !== 196) { + if (node.kind !== 194 && node.kind !== 195) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204; + return node && node.kind === 203; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -11970,69 +11968,69 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 && + node.parent.kind === 154 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160: case 159: - case 162: + case 158: case 161: + case 160: + case 163: case 164: - case 165: - case 285: - case 282: - case 195: + case 284: + case 281: + case 194: return parent.name === node; - case 154: + case 153: if (parent.right === node) { - while (parent.kind === 154) { + while (parent.kind === 153) { parent = parent.parent; } - return parent.kind === 173 || parent.kind === 170; + return parent.kind === 172 || parent.kind === 169; } return false; - case 192: - case 259: + case 191: + case 258: return parent.propertyName === node; - case 264: - case 274: + case 263: + case 273: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 254 || - node.kind === 253 || - node.kind === 256 && !!node.name || - node.kind === 257 || + return node.kind === 253 || + node.kind === 252 || + node.kind === 255 && !!node.name || + node.kind === 256 || + node.kind === 262 || + node.kind === 258 || node.kind === 263 || - node.kind === 259 || - node.kind === 264 || - node.kind === 260 && exportAssignmentIsAlias(node) || + node.kind === 259 && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 && isAliasableExpression(node.parent.right) || - node.kind === 283 || - node.kind === 282 && isAliasableExpression(node.initializer); + node.kind === 282 || + node.kind === 281 && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { + case 255: + case 258: case 256: + case 263: case 259: - case 257: - case 264: - case 260: - case 254: + case 253: return node.parent; - case 154: + case 153: do { node = node.parent; - } while (node.parent.kind === 154); + } while (node.parent.kind === 153); return getAliasDeclarationFromName(node); } } @@ -12051,7 +12049,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 ? node.name : node.kind === 282 ? node.initializer : + return node.kind === 282 ? node.name : node.kind === 281 ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -12115,11 +12113,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 <= token && token <= 153; + return 77 <= token && token <= 152; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 <= token && token <= 153; + return 122 <= token && token <= 152; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -12155,13 +12153,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 245: - case 202: - case 162: + case 244: + case 201: + case 161: if (node.asteriskToken) { flags |= 1; } - case 203: + case 202: if (hasModifier(node, 256)) { flags |= 2; } @@ -12175,10 +12173,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245: + case 244: + case 201: case 202: - case 203: - case 162: + case 161: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256); @@ -12200,7 +12198,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 || name.kind === 196)) { + if (!(name.kind === 154 || name.kind === 195)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -12221,7 +12219,7 @@ var ts; case 10: case 8: return ts.escapeLeadingUnderscores(name.text); - case 155: + case 154: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -12281,11 +12279,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157; + return root.kind === 156; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192) { + while (node.kind === 191) { node = node.parent.parent; } return node; @@ -12293,15 +12291,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 + return kind === 162 + || kind === 201 + || kind === 244 || kind === 202 - || kind === 245 - || kind === 203 - || kind === 162 + || kind === 161 + || kind === 163 || kind === 164 - || kind === 165 - || kind === 250 - || kind === 291; + || kind === 249 + || kind === 290; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -12315,23 +12313,23 @@ var ts; ts.getOriginalSourceFile = getOriginalSourceFile; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198: + case 197: return hasArguments ? 0 : 1; - case 208: - case 205: - case 206: - case 204: case 207: - case 211: - case 213: - return 1; + case 204: + case 205: + case 203: + case 206: case 210: + case 212: + return 1; + case 209: switch (operator) { case 42: case 62: @@ -12355,15 +12353,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210) { + if (expression.kind === 209) { return expression.operatorToken.kind; } - else if (expression.kind === 208 || expression.kind === 209) { + else if (expression.kind === 207 || expression.kind === 208) { return expression.operator; } else { @@ -12373,15 +12371,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328: + case 327: return 0; - case 214: - return 1; case 213: + return 1; + case 212: return 2; - case 211: - return 4; case 210: + return 4; + case 209: switch (operatorKind) { case 27: return 0; @@ -12402,21 +12400,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208: - case 205: - case 206: - case 204: case 207: + case 204: + case 205: + case 203: + case 206: return 16; - case 209: + case 208: return 17; - case 197: - return 18; - case 198: - return hasArguments ? 19 : 18; - case 199: - case 195: case 196: + return 18; + case 197: + return hasArguments ? 19 : 18; + case 198: + case 194: + case 195: return 19; case 104: case 102: @@ -12427,19 +12425,19 @@ var ts; case 8: case 9: case 10: + case 192: case 193: - case 194: + case 201: case 202: - case 203: - case 215: + case 214: + case 266: case 267: - case 268: - case 271: + case 270: case 13: case 14: - case 212: - case 201: - case 216: + case 211: + case 200: + case 215: return 20; default: return -1; @@ -13003,10 +13001,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164) { + if (accessor.kind === 163) { getAccessor = accessor; } - else if (accessor.kind === 165) { + else if (accessor.kind === 164) { setAccessor = accessor; } else { @@ -13026,10 +13024,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 && !getAccessor) { + if (member.kind === 163 && !getAccessor) { getAccessor = member; } - if (member.kind === 165 && !setAccessor) { + if (member.kind === 164 && !setAccessor) { setAccessor = member; } } @@ -13068,7 +13066,7 @@ var ts; } ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 && tag.parent.tags.some(isJSDocTypeAlias)); } function getEffectiveSetAccessorTypeAnnotationNode(node) { var parameter = getSetAccessorValueParameter(node); @@ -13244,7 +13242,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 && node.kind <= 153) { + if (node.kind >= 0 && node.kind <= 152) { return 0; } if (node.modifierFlagsCache & 536870912) { @@ -13284,11 +13282,11 @@ var ts; case 117: return 8; case 122: return 128; case 89: return 1; - case 131: return 2; + case 130: return 2; case 81: return 2048; case 84: return 512; case 126: return 256; - case 139: return 64; + case 138: return 64; } return 0; } @@ -13327,8 +13325,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 194 - || kind === 193; + return kind === 193 + || kind === 192; } return false; } @@ -13345,12 +13343,12 @@ var ts; switch (node.kind) { case 75: return node; - case 154: + case 153: do { node = node.left; } while (node.kind !== 75); return node; - case 195: + case 194: do { node = node.expression; } while (node.kind !== 75); @@ -13360,8 +13358,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 || node.kind === 104 || node.kind === 102 || - node.kind === 195 && isDottedName(node.expression) || - node.kind === 201 && isDottedName(node.expression); + node.kind === 194 && isDottedName(node.expression) || + node.kind === 200 && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -13391,17 +13389,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 && node.parent.right === node) || - (node.parent.kind === 195 && node.parent.name === node); + return (node.parent.kind === 153 && node.parent.right === node) || + (node.parent.kind === 194 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 && + return expression.kind === 193 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 && + return expression.kind === 192 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -13665,8 +13663,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { + case 248: case 249: - case 250: return parseNode === parseNode.parent.name; } } @@ -13732,32 +13730,32 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 201: + case 200: return accessKind(parent); - case 209: case 208: + case 207: var operator = parent.operator; return operator === 45 || operator === 46 ? writeOrReadWrite() : 0; - case 210: + case 209: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 ? 1 : writeOrReadWrite() : 0; - case 195: + case 194: return parent.name !== node ? 0 : accessKind(parent); - case 282: { + case 281: { var parentAccess = accessKind(parent.parent); return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283: + case 282: return node === parent.objectAssignmentInitializer ? 0 : accessKind(parent.parent); - case 193: + case 192: return accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 ? 1 : 2; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 ? 1 : 2; } } function reverseAccessKind(a) { @@ -13888,39 +13886,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 && kind <= 189) + return (kind >= 168 && kind <= 188) || kind === 125 - || kind === 149 + || kind === 148 + || kind === 140 + || kind === 151 || kind === 141 - || kind === 152 - || kind === 142 - || kind === 129 + || kind === 128 + || kind === 143 || kind === 144 - || kind === 145 || kind === 104 || kind === 110 - || kind === 147 + || kind === 146 || kind === 100 - || kind === 138 - || kind === 217 + || kind === 137 + || kind === 216 + || kind === 295 || kind === 296 || kind === 297 || kind === 298 || kind === 299 || kind === 300 - || kind === 301 - || kind === 302; + || kind === 301; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 || node.kind === 196; + return node.kind === 194 || node.kind === 195; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195) { + if (node.kind === 194) { return node.name; } - ts.Debug.assert(node.kind === 196); + ts.Debug.assert(node.kind === 195); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -13935,7 +13933,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 || node.kind === 262; + return node.kind === 257 || node.kind === 261; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -14905,37 +14903,37 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264; + return typeOnlyDeclaration.kind === 263; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 || node.kind === 195) { + while (node.kind === 75 || node.kind === 194) { node = node.parent; } - if (node.kind !== 155) { + if (node.kind !== 154) { return false; } if (hasModifier(node.parent, 128)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 || containerKind === 174; + return containerKind === 246 || containerKind === 173; } function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 75) return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280: + case 279: return true; - case 195: - case 217: + case 194: + case 216: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246; } })(ts || (ts = {})); var ts; @@ -14946,7 +14944,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291) { + if (kind === 290) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75) { @@ -14987,19 +14985,19 @@ var ts; } ts.isJSDocLikeText = isJSDocLikeText; function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153) { + if (!node || node.kind <= 152) { return; } switch (node.kind) { - case 154: + case 153: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156: + case 155: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283: + case 282: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -15007,9 +15005,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284: + case 283: return visitNode(cbNode, node.expression); - case 157: + case 156: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -15017,59 +15015,59 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.exclamationToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282: + case 158: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 281: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243: + case 242: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192: + case 191: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 170: case 171: - case 172: + case 165: case 166: case 167: - case 168: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162: case 161: + case 160: + case 162: case 163: case 164: - case 165: + case 201: + case 244: case 202: - case 245: - case 203: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -15081,185 +15079,192 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170: + case 169: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169: + case 168: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173: + case 172: return visitNode(cbNode, node.exprName); - case 174: + case 173: return visitNodes(cbNode, cbNodes, node.members); - case 175: + case 174: return visitNode(cbNode, node.elementType); - case 176: + case 175: return visitNodes(cbNode, cbNodes, node.elementTypes); + case 178: case 179: - case 180: return visitNodes(cbNode, cbNodes, node.types); - case 181: + case 180: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182: + case 181: return visitNode(cbNode, node.typeParameter); - case 189: + case 188: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183: - case 185: + case 182: + case 184: return visitNode(cbNode, node.type); - case 186: + case 185: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187: + case 186: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188: + case 187: return visitNode(cbNode, node.literal); + case 189: case 190: - case 191: + return visitNodes(cbNode, cbNodes, node.elements); + case 192: return visitNodes(cbNode, cbNodes, node.elements); case 193: - return visitNodes(cbNode, cbNodes, node.elements); - case 194: return visitNodes(cbNode, cbNodes, node.properties); - case 195: + case 194: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196: + case 195: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); + case 196: case 197: - case 198: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199: + case 198: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200: + case 199: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201: + case 200: + return visitNode(cbNode, node.expression); + case 203: return visitNode(cbNode, node.expression); case 204: return visitNode(cbNode, node.expression); case 205: return visitNode(cbNode, node.expression); + case 207: + return visitNode(cbNode, node.operand); + case 212: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 206: return visitNode(cbNode, node.expression); case 208: return visitNode(cbNode, node.operand); - case 213: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); - case 207: - return visitNode(cbNode, node.expression); case 209: - return visitNode(cbNode, node.operand); - case 210: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218: + case 217: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219: + case 218: return visitNode(cbNode, node.expression); - case 220: + case 219: return visitNode(cbNode, node.name); - case 211: + case 210: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214: + case 213: return visitNode(cbNode, node.expression); - case 224: - case 251: + case 223: + case 250: return visitNodes(cbNode, cbNodes, node.statements); - case 291: + case 290: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226: + case 225: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244: + case 243: return visitNodes(cbNode, cbNodes, node.declarations); - case 227: + case 226: return visitNode(cbNode, node.expression); - case 228: + case 227: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229: + case 228: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230: + case 229: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231: + case 230: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232: + case 231: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233: + case 232: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 233: case 234: - case 235: return visitNode(cbNode, node.label); - case 236: + case 235: return visitNode(cbNode, node.expression); + case 236: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); case 237: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 238: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252: + case 251: return visitNodes(cbNode, cbNodes, node.clauses); - case 278: + case 277: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279: + case 278: return visitNodes(cbNode, cbNodes, node.statements); - case 239: + case 238: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240: + case 239: return visitNode(cbNode, node.expression); - case 241: + case 240: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281: + case 280: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158: + case 157: return visitNode(cbNode, node.expression); + case 245: + case 214: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || + visitNodes(cbNode, cbNodes, node.members); case 246: - case 215: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -15271,169 +15276,162 @@ var ts; visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); + visitNode(cbNode, node.type); case 248: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNode, cbNodes, node.members); + case 284: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 249: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.members); - case 285: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); - case 250: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254: + case 253: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255: + case 254: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256: + case 255: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253: + case 252: + return visitNode(cbNode, node.name); + case 256: + return visitNode(cbNode, node.name); + case 262: return visitNode(cbNode, node.name); case 257: - return visitNode(cbNode, node.name); - case 263: - return visitNode(cbNode, node.name); - case 258: - case 262: - return visitNodes(cbNode, cbNodes, node.elements); case 261: + return visitNodes(cbNode, cbNodes, node.elements); + case 260: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259: - case 264: + case 258: + case 263: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260: + case 259: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212: + case 211: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222: + case 221: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155: + case 154: return visitNode(cbNode, node.expression); - case 280: + case 279: return visitNodes(cbNode, cbNodes, node.types); - case 217: + case 216: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266: - return visitNode(cbNode, node.expression); case 265: + return visitNode(cbNode, node.expression); + case 264: return visitNodes(cbNode, cbNodes, node.decorators); - case 328: + case 327: return visitNodes(cbNode, cbNodes, node.elements); - case 267: + case 266: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271: + case 270: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); + case 267: case 268: - case 269: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275: - return visitNodes(cbNode, cbNodes, node.properties); case 274: + return visitNodes(cbNode, cbNodes, node.properties); + case 273: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276: + case 275: return visitNode(cbNode, node.expression); - case 277: + case 276: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270: + case 269: return visitNode(cbNode, node.tagName); + case 176: case 177: - case 178: - case 295: - case 299: + case 294: case 298: - case 300: - case 302: - return visitNode(cbNode, node.type); + case 297: + case 299: case 301: + return visitNode(cbNode, node.type); + case 300: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304: + case 303: return visitNodes(cbNode, cbNodes, node.tags); - case 318: - case 324: + case 317: + case 323: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310: - return visitNode(cbNode, node.tagName); case 309: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName); case 308: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322: + case 307: + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); + case 321: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323: + case 322: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 + node.typeExpression.kind === 294 ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316: + case 315: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319: - case 321: + case 318: case 320: - case 317: + case 319: + case 316: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306: + case 305: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305: + case 304: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307: + case 306: + case 310: case 311: case 312: case 313: case 314: - case 315: return visitNode(cbNode, node.tagName); - case 327: + case 326: return visitNode(cbNode, node.expression); } } @@ -15603,7 +15601,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227); + var statement = createNode(226); switch (token()) { case 22: statement.expression = parseArrayLiteralExpression(); @@ -15742,7 +15740,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { - var sourceFile = new SourceFileConstructor(291, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(290, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -16016,7 +16014,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 && (kind !== 227 || token() !== 20)) { + if (scanner.getTokenFlags() & 2 && (kind !== 226 || token() !== 20)) { addJSDocComment(node); } return node; @@ -16114,7 +16112,7 @@ var ts; return parsePropertyNameWorker(true); } function parseComputedPropertyName() { - var node = createNode(155); + var node = createNode(154); parseExpected(22); node.expression = allowInAnd(parseExpression); parseExpected(23); @@ -16152,15 +16150,15 @@ var ts; if (token() === 84) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146) { + if (token() === 145) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84: return nextTokenCanFollowDefaultKeyword(); case 120: - case 132: - case 143: + case 131: + case 142: nextToken(); return canFollowModifier(); default: @@ -16460,17 +16458,17 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163: - case 168: - case 164: - case 165: - case 160: - case 223: - return true; case 162: + case 167: + case 163: + case 164: + case 159: + case 222: + return true; + case 161: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 75 && - methodDeclaration.name.originalKeywordKind === 130; + methodDeclaration.name.originalKeywordKind === 129; return !nameIsConstructor; } } @@ -16479,8 +16477,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { + case 277: case 278: - case 279: return true; } } @@ -16489,65 +16487,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245: - case 226: - case 224: - case 228: + case 244: + case 225: + case 223: case 227: - case 240: - case 236: - case 238: + case 226: + case 239: case 235: + case 237: case 234: - case 232: case 233: case 231: + case 232: case 230: - case 237: - case 225: - case 241: - case 239: case 229: - case 242: - case 255: + case 236: + case 224: + case 240: + case 238: + case 228: + case 241: case 254: - case 261: + case 253: case 260: - case 250: - case 246: - case 247: + case 259: case 249: + case 245: + case 246: case 248: + case 247: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285; + return node.kind === 284; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167: - case 161: - case 168: - case 159: case 166: + case 160: + case 167: + case 158: + case 165: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243) { + if (node.kind !== 242) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157) { + if (node.kind !== 156) { return false; } var parameter = node; @@ -16664,7 +16662,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154, entity.pos); + var node = createNode(153, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -16683,7 +16681,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212); + var template = createNode(211); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15, "Template head has wrong token kind"); var list = []; @@ -16695,7 +16693,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222); + var span = createNode(221); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19) { @@ -16754,7 +16752,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(170); + var node = createNode(169); node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) { node.typeArguments = parseBracketedList(20, parseType, 29, 31); @@ -16763,14 +16761,14 @@ var ts; } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170: + case 169: return ts.nodeIsMissing(node.typeName); - case 171: - case 172: { + case 170: + case 171: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183: + case 182: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -16778,20 +16776,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169, lhs.pos); + var node = createNode(168, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184); + var node = createNode(183); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296); + var result = createNode(295); if (postFixEquals) { - return createPostfixType(300, result); + return createPostfixType(299, result); } else { nextToken(); @@ -16799,7 +16797,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299); + var result = createNode(298); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -16813,28 +16811,28 @@ var ts; token() === 31 || token() === 62 || token() === 51) { - var result = createNode(297, pos); + var result = createNode(296, pos); return finishNode(result); } else { - var result = createNode(298, pos); + var result = createNode(297, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301); + var result = createNodeWithJSDoc(300); nextToken(); fillSignature(58, 4 | 32, result); return finishNode(result); } - var node = createNode(170); + var node = createNode(169); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157); + var parameter = createNode(156); if (token() === 104 || token() === 99) { parameter.name = parseIdentifierName(); parseExpected(58); @@ -16844,9 +16842,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136); + var moduleSpecifier = parseOptionalToken(135); if (moduleSpecifier) { - var moduleTag = createNode(303, moduleSpecifier.pos); + var moduleTag = createNode(302, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19: @@ -16865,23 +16863,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302, dotdotdot.pos); + var variadic = createNode(301, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62) { - return createPostfixType(300, type); + return createPostfixType(299, type); } return type; } function parseTypeQuery() { - var node = createNode(173); + var node = createNode(172); parseExpected(108); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156); + var node = createNode(155); node.name = parseIdentifier(); if (parseOptional(90)) { if (isStartOfType() || !isStartOfExpression()) { @@ -16915,7 +16913,7 @@ var ts; isStartOfType(!isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157); + var node = createNodeWithJSDoc(156); if (token() === 104) { node.name = createIdentifier(true); node.type = parseParameterType(); @@ -16984,7 +16982,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167) { + if (kind === 166) { parseExpected(99); } fillSignature(58, 4, node); @@ -17021,7 +17019,7 @@ var ts; return token() === 58 || token() === 27 || token() === 23; } function parseIndexSignatureDeclaration(node) { - node.kind = 168; + node.kind = 167; node.parameters = parseBracketedList(16, parseParameter, 22, 23); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -17031,11 +17029,11 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57); if (token() === 20 || token() === 29) { - node.kind = 161; + node.kind = 160; fillSignature(58, 4, node); } else { - node.kind = 159; + node.kind = 158; node.type = parseTypeAnnotation(); if (token() === 62) { node.initializer = parseInitializer(); @@ -17072,10 +17070,10 @@ var ts; } function parseTypeMember() { if (token() === 20 || token() === 29) { - return parseSignatureMember(166); + return parseSignatureMember(165); } if (token() === 99 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167); + return parseSignatureMember(166); } var node = createNodeWithJSDoc(0); node.modifiers = parseModifiers(); @@ -17101,7 +17099,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174); + var node = createNode(173); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -17119,27 +17117,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 || token() === 40) { - return nextToken() === 139; + return nextToken() === 138; } - if (token() === 139) { + if (token() === 138) { nextToken(); } return token() === 22 && nextTokenIsIdentifier() && nextToken() === 97; } function parseMappedTypeParameter() { - var node = createNode(156); + var node = createNode(155); node.name = parseIdentifier(); parseExpected(97); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187); + var node = createNode(186); parseExpected(18); - if (token() === 139 || token() === 39 || token() === 40) { + if (token() === 138 || token() === 39 || token() === 40) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139) { - parseExpectedToken(139); + if (node.readonlyToken.kind !== 138) { + parseExpectedToken(138); } } parseExpected(22); @@ -17159,23 +17157,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25)) { - var node = createNode(178, pos); + var node = createNode(177, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304) && type.kind === 298 && type.pos === type.type.pos) { - type.kind = 177; + if (!(contextFlags & 4194304) && type.kind === 297 && type.pos === type.type.pos) { + type.kind = 176; } return type; } function parseTupleType() { - var node = createNode(176); + var node = createNode(175); node.elementTypes = parseBracketedList(21, parseTupleElementType, 22, 23); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183); + var node = createNode(182); parseExpected(20); node.type = parseType(); parseExpected(21); @@ -17183,7 +17181,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99) ? 172 : 171; + var kind = parseOptional(99) ? 171 : 170; var node = createNodeWithJSDoc(kind, pos); fillSignature(38, 4, node); return finishNode(node); @@ -17193,10 +17191,10 @@ var ts; return token() === 24 ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188); + var node = createNode(187); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208); + unaryMinusExpression = createNode(207); unaryMinusExpression.operator = 40; nextToken(); } @@ -17217,7 +17215,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576; - var node = createNode(189); + var node = createNode(188); if (parseOptional(108)) { node.isTypeOf = true; } @@ -17240,15 +17238,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125: - case 149: + case 148: + case 143: + case 140: + case 151: case 144: + case 128: + case 146: + case 137: case 141: - case 152: - case 145: - case 129: - case 147: - case 138: - case 142: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41: return parseJSDocAllType(false); @@ -17276,7 +17274,7 @@ var ts; return parseTokenNode(); case 104: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -17302,20 +17300,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125: - case 149: - case 144: - case 141: - case 152: - case 129: - case 139: - case 145: case 148: - case 110: + case 143: + case 140: + case 151: + case 128: + case 138: + case 144: case 147: + case 110: + case 146: case 100: case 104: case 108: - case 138: + case 137: case 18: case 22: case 29: @@ -17327,12 +17325,12 @@ var ts; case 9: case 106: case 91: - case 142: + case 141: case 41: case 57: case 53: case 25: - case 133: + case 132: case 96: case 124: return true; @@ -17355,25 +17353,25 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53: - type = createPostfixType(299, type); + type = createPostfixType(298, type); break; case 57: if (!(contextFlags & 4194304) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298, type); + type = createPostfixType(297, type); break; case 22: parseExpected(22); if (isStartOfType()) { - var node = createNode(186, type.pos); + var node = createNode(185, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23); type = finishNode(node); } else { - var node = createNode(175, type.pos); + var node = createNode(174, type.pos); node.elementType = type; parseExpected(23); type = finishNode(node); @@ -17392,16 +17390,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185); + var node = createNode(184); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182); - parseExpected(133); - var typeParameter = createNode(156); + var node = createNode(181); + parseExpected(132); + var typeParameter = createNode(155); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -17409,12 +17407,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135: - case 148: - case 139: - case 128: + case 134: + case 147: + case 138: return parseTypeOperator(operator); - case 133: + case 132: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -17435,10 +17432,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180, parseTypeOperatorOrHigher, 50); + return parseUnionOrIntersectionType(179, parseTypeOperatorOrHigher, 50); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179, parseIntersectionTypeOrHigher, 51); + return parseUnionOrIntersectionType(178, parseIntersectionTypeOrHigher, 51); } function isStartOfFunctionType() { if (token() === 29) { @@ -17484,7 +17481,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169, typePredicateVariable.pos); + var node = createNode(168, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -17496,16 +17493,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169); + var node = createNode(168); node.assertsModifier = parseExpectedToken(124); node.parameterName = token() === 104 ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134) ? parseType() : undefined; + node.type = parseOptional(133) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -17517,7 +17514,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90)) { - var node = createNode(181, type.pos); + var node = createNode(180, type.pos); node.checkType = type; node.extendsType = parseTypeWorker(true); parseExpected(57); @@ -17641,7 +17638,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213); + var node = createNode(212); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 41 || isStartOfExpression())) { @@ -17657,13 +17654,13 @@ var ts; ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203, asyncModifier.pos); + node = createNode(202, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203, identifier.pos); + node = createNode(202, identifier.pos); } - var parameter = createNode(157, identifier.pos); + var parameter = createNode(156, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -17817,7 +17814,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203); + var node = createNodeWithJSDoc(202); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126) ? 2 : 0; if (!fillSignature(58, isAsync, node) && !allowAmbiguity) { @@ -17849,7 +17846,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(211, leftOperand.pos); + var node = createNode(210, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -17864,7 +17861,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 || t === 153; + return t === 97 || t === 152; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -17901,39 +17898,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210, left.pos); + var node = createNode(209, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218, left.pos); + var node = createNode(217, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208); + var node = createNode(207); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204); + var node = createNode(203); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205); + var node = createNode(204); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206); + var node = createNode(205); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -17948,7 +17945,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207); + var node = createNode(206); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -17965,7 +17962,7 @@ var ts; if (token() === 42) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200) { + if (simpleUnaryExpression.kind === 199) { parseErrorAt(pos, end, 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 { @@ -18018,7 +18015,7 @@ var ts; } function parseUpdateExpression() { if (token() === 45 || token() === 46) { - var node = createNode(208); + var node = createNode(207); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -18030,7 +18027,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 || token() === 46) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209, expression.pos); + var node = createNode(208, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -18049,7 +18046,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); nextToken(); - var node = createNode(220, fullStart); + var node = createNode(219, fullStart); node.keywordToken = 96; node.name = parseIdentifierName(); expression = finishNode(node); @@ -18080,7 +18077,7 @@ var ts; if (token() === 20 || token() === 24 || token() === 22) { return expression; } - var node = createNode(195, expression.pos); + var node = createNode(194, expression.pos); node.expression = expression; parseExpectedToken(24, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true, true); @@ -18089,8 +18086,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269) { - var node = createNode(267, opening.pos); + if (opening.kind === 268) { + var node = createNode(266, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -18099,22 +18096,22 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272) { - var node = createNode(271, opening.pos); + else if (opening.kind === 271) { + var node = createNode(270, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268); + ts.Debug.assert(opening.kind === 267); result = opening; } if (inExpressionContext && token() === 29) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210, result.pos); + var badNode = createNode(209, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -18173,7 +18170,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275); + var jsxAttributes = createNode(274); jsxAttributes.properties = parseList(13, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -18181,7 +18178,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(29); if (token() === 31) { - var node_1 = createNode(272, fullStart); + var node_1 = createNode(271, fullStart); scanJsxText(); return finishNode(node_1); } @@ -18190,7 +18187,7 @@ var ts; var attributes = parseJsxAttributes(); var node; if (token() === 31) { - node = createNode(269, fullStart); + node = createNode(268, fullStart); scanJsxText(); } else { @@ -18202,7 +18199,7 @@ var ts; parseExpected(31, undefined, false); scanJsxText(); } - node = createNode(268, fullStart); + node = createNode(267, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -18214,7 +18211,7 @@ var ts; var expression = token() === 104 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24)) { - var propertyAccess = createNode(195, expression.pos); + var propertyAccess = createNode(194, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true, false); expression = finishNode(propertyAccess); @@ -18222,7 +18219,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277); + var node = createNode(276); if (!parseExpected(18)) { return undefined; } @@ -18245,7 +18242,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274); + var node = createNode(273); node.name = parseIdentifierName(); if (token() === 62) { switch (scanJsxAttributeValue()) { @@ -18260,7 +18257,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276); + var node = createNode(275); parseExpected(18); parseExpected(25); node.expression = parseExpression(); @@ -18268,7 +18265,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270); + var node = createNode(269); parseExpected(30); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -18281,7 +18278,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273); + var node = createNode(272); parseExpected(30); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -18296,7 +18293,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200); + var node = createNode(199); parseExpected(29); node.type = parseType(); parseExpected(31); @@ -18313,12 +18310,31 @@ var ts; return token() === 28 && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32) { + return true; + } + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32)) { + expr = expr.expression; + } + if (expr.flags & 32) { + while (ts.isNonNullExpression(node)) { + node.flags |= 32; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195, expression.pos); + var propertyAccess = createNode(194, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(true, true); - if (questionDotToken || expression.flags & 32) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -18327,7 +18343,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196, expression.pos); + var indexedAccess = createNode(195, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23) { @@ -18341,7 +18357,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23); - if (questionDotToken || expression.flags & 32) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32; } return finishNode(indexedAccess); @@ -18363,7 +18379,7 @@ var ts; } if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219, expression.pos); + var nonNullExpression = createNode(218, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -18383,7 +18399,7 @@ var ts; return token() === 14 || token() === 15; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199, tag.pos); + var tagExpression = createNode(198, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -18406,12 +18422,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197, expression.pos); + var callExpr = createNode(196, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32; } expression = finishNode(callExpr); @@ -18419,18 +18435,18 @@ var ts; } } else if (token() === 20) { - var callExpr = createNode(197, expression.pos); + var callExpr = createNode(196, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32; } expression = finishNode(callExpr); continue; } if (questionDotToken) { - var propertyAccess = createNode(195, expression.pos); + var propertyAccess = createNode(194, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75, false, ts.Diagnostics.Identifier_expected); @@ -18532,28 +18548,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201); + var node = createNodeWithJSDoc(200); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214); + var node = createNode(213); parseExpected(25); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 ? parseSpreadElement() : - token() === 27 ? createNode(216) : + token() === 27 ? createNode(215) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193); + var node = createNode(192); parseExpected(22); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -18565,17 +18581,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0); if (parseOptionalToken(25)) { - node.kind = 284; + node.kind = 283; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132)) { - return parseAccessorDeclaration(node, 164); + if (parseContextualModifier(131)) { + return parseAccessorDeclaration(node, 163); } - if (parseContextualModifier(143)) { - return parseAccessorDeclaration(node, 165); + if (parseContextualModifier(142)) { + return parseAccessorDeclaration(node, 164); } var asteriskToken = parseOptionalToken(41); var tokenIsIdentifier = isIdentifier(); @@ -18587,7 +18603,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58); if (isShorthandPropertyAssignment) { - node.kind = 283; + node.kind = 282; var equalsToken = parseOptionalToken(62); if (equalsToken) { node.equalsToken = equalsToken; @@ -18595,14 +18611,14 @@ var ts; } } else { - node.kind = 282; + node.kind = 281; parseExpected(58); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194); + var node = createNode(193); var openBracePosition = scanner.getTokenPos(); parseExpected(18); if (scanner.hasPrecedingLineBreak()) { @@ -18622,7 +18638,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNodeWithJSDoc(202); + var node = createNodeWithJSDoc(201); node.modifiers = parseModifiers(); parseExpected(94); node.asteriskToken = parseOptionalToken(41); @@ -18647,7 +18663,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99); if (parseOptional(24)) { - var node_2 = createNode(220, fullStart); + var node_2 = createNode(219, fullStart); node_2.keywordToken = 99; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -18664,7 +18680,7 @@ var ts; } break; } - var node = createNode(198, fullStart); + var node = createNode(197, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20) { @@ -18673,7 +18689,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224); + var node = createNode(223); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -18710,12 +18726,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225); + var node = createNode(224); parseExpected(26); return finishNode(node); } function parseIfStatement() { - var node = createNode(228); + var node = createNode(227); parseExpected(95); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18725,7 +18741,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229); + var node = createNode(228); parseExpected(86); node.statement = parseStatement(); parseExpected(111); @@ -18736,7 +18752,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230); + var node = createNode(229); parseExpected(111); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18759,8 +18775,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153) : parseOptional(153)) { - var forOfStatement = createNode(233, pos); + if (awaitToken ? parseExpected(152) : parseOptional(152)) { + var forOfStatement = createNode(232, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -18768,14 +18784,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97)) { - var forInStatement = createNode(232, pos); + var forInStatement = createNode(231, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231, pos); + var forStatement = createNode(230, pos); forStatement.initializer = initializer; parseExpected(26); if (token() !== 26 && token() !== 21) { @@ -18793,7 +18809,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 ? 77 : 82); + parseExpected(kind === 234 ? 77 : 82); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -18801,7 +18817,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236); + var node = createNode(235); parseExpected(101); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -18810,7 +18826,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237); + var node = createNode(236); parseExpected(112); parseExpected(20); node.expression = allowInAnd(parseExpression); @@ -18819,7 +18835,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278); + var node = createNode(277); parseExpected(78); node.expression = allowInAnd(parseExpression); parseExpected(58); @@ -18827,7 +18843,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279); + var node = createNode(278); parseExpected(84); parseExpected(58); node.statements = parseList(3, parseStatement); @@ -18837,12 +18853,12 @@ var ts; return token() === 78 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238); + var node = createNode(237); parseExpected(103); parseExpected(20); node.expression = allowInAnd(parseExpression); parseExpected(21); - var caseBlock = createNode(252); + var caseBlock = createNode(251); parseExpected(18); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(19); @@ -18850,14 +18866,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(240); + var node = createNode(239); parseExpected(105); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(241); + var node = createNode(240); parseExpected(107); node.tryBlock = parseBlock(false); node.catchClause = token() === 79 ? parseCatchClause() : undefined; @@ -18868,7 +18884,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281); + var result = createNode(280); parseExpected(79); if (parseOptional(20)) { result.variableDeclaration = parseVariableDeclaration(); @@ -18881,21 +18897,21 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242); + var node = createNode(241); parseExpected(83); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { - var node = createNodeWithJSDoc(token() === 75 ? 0 : 227); + var node = createNodeWithJSDoc(token() === 75 ? 0 : 226); var expression = allowInAnd(parseExpression); if (expression.kind === 75 && parseOptional(58)) { - node.kind = 239; + node.kind = 238; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227; + node.kind = 226; node.expression = expression; parseSemicolon(); } @@ -18928,24 +18944,24 @@ var ts; case 88: return true; case 114: - case 146: + case 145: return nextTokenIsIdentifierOnSameLine(); + case 135: case 136: - case 137: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122: case 126: - case 131: + case 130: case 117: case 118: case 119: - case 139: + case 138: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151: + case 150: nextToken(); return token() === 18 || token() === 75 || token() === 89; case 96: @@ -18954,7 +18970,7 @@ var ts; token() === 18 || ts.tokenIsIdentifierOrKeyword(token()); case 89: var currentToken_1 = nextToken(); - if (currentToken_1 === 146) { + if (currentToken_1 === 145) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 || currentToken_1 === 41 || @@ -19005,18 +19021,18 @@ var ts; case 89: return isStartOfDeclaration(); case 126: - case 131: + case 130: case 114: + case 135: case 136: - case 137: - case 146: - case 151: + case 145: + case 150: return true; case 119: case 117: case 118: case 120: - case 139: + case 138: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -19036,16 +19052,16 @@ var ts; case 18: return parseBlock(false); case 109: - return parseVariableStatement(createNodeWithJSDoc(243)); + return parseVariableStatement(createNodeWithJSDoc(242)); case 115: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243)); + return parseVariableStatement(createNodeWithJSDoc(242)); } break; case 94: - return parseFunctionDeclaration(createNodeWithJSDoc(245)); + return parseFunctionDeclaration(createNodeWithJSDoc(244)); case 80: - return parseClassDeclaration(createNodeWithJSDoc(246)); + return parseClassDeclaration(createNodeWithJSDoc(245)); case 95: return parseIfStatement(); case 86: @@ -19055,9 +19071,9 @@ var ts; case 93: return parseForOrForInOrForOfStatement(); case 82: - return parseBreakOrContinueStatement(234); + return parseBreakOrContinueStatement(233); case 77: - return parseBreakOrContinueStatement(235); + return parseBreakOrContinueStatement(234); case 101: return parseReturnStatement(); case 112: @@ -19076,10 +19092,10 @@ var ts; return parseDeclaration(); case 126: case 114: - case 146: + case 145: + case 135: case 136: - case 137: - case 131: + case 130: case 81: case 88: case 89: @@ -19089,8 +19105,8 @@ var ts; case 119: case 122: case 120: - case 139: - case 151: + case 138: + case 150: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -19099,7 +19115,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131; + return modifier.kind === 130; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -19144,13 +19160,13 @@ var ts; return parseClassDeclaration(node); case 114: return parseInterfaceDeclaration(node); - case 146: + case 145: return parseTypeAliasDeclaration(node); case 88: return parseEnumDeclaration(node); - case 151: + case 150: + case 135: case 136: - case 137: return parseModuleDeclaration(node); case 96: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -19167,7 +19183,7 @@ var ts; } default: if (node.decorators || node.modifiers) { - var missing = createMissingNode(265, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264, true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -19189,16 +19205,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 27) { - return createNode(216); + return createNode(215); } - var node = createNode(192); + var node = createNode(191); node.dotDotDotToken = parseOptionalToken(25); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192); + var node = createNode(191); node.dotDotDotToken = parseOptionalToken(25); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -19214,14 +19230,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190); + var node = createNode(189); parseExpected(18); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(19); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191); + var node = createNode(190); parseExpected(22); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(23); @@ -19246,7 +19262,7 @@ var ts; return parseVariableDeclaration(true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243); + var node = createNode(242); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 && token() === 53 && !scanner.hasPrecedingLineBreak()) { @@ -19259,7 +19275,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244); + var node = createNode(243); switch (token()) { case 109: break; @@ -19273,7 +19289,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 153 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -19288,13 +19304,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21; } function parseVariableStatement(node) { - node.kind = 226; + node.kind = 225; node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245; + node.kind = 244; parseExpected(94); node.asteriskToken = parseOptionalToken(41); node.name = hasModifierOfKind(node, 84) ? parseOptionalIdentifier() : parseIdentifier(); @@ -19305,8 +19321,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130) { - return parseExpected(130); + if (token() === 129) { + return parseExpected(129); } if (token() === 10 && lookAhead(nextToken) === 20) { return tryParse(function () { @@ -19318,7 +19334,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163; + node.kind = 162; fillSignature(58, 0, node); node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected); return finishNode(node); @@ -19326,7 +19342,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162; + node.kind = 161; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 : 0; var isAsync = hasModifierOfKind(node, 126) ? 2 : 0; @@ -19335,7 +19351,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160; + node.kind = 159; if (!node.questionToken && token() === 53 && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -19383,7 +19399,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 143 || idToken === 132) { + if (!ts.isKeyword(idToken) || idToken === 142 || idToken === 131) { return true; } switch (token()) { @@ -19408,7 +19424,7 @@ var ts; if (!parseOptional(59)) { break; } - var decorator = createNode(158, decoratorStart); + var decorator = createNode(157, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -19449,20 +19465,20 @@ var ts; } function parseClassElement() { if (token() === 26) { - var result = createNode(223); + var result = createNode(222); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0); node.decorators = parseDecorators(); node.modifiers = parseModifiers(true); - if (parseContextualModifier(132)) { + if (parseContextualModifier(131)) { + return parseAccessorDeclaration(node, 163); + } + if (parseContextualModifier(142)) { return parseAccessorDeclaration(node, 164); } - if (parseContextualModifier(143)) { - return parseAccessorDeclaration(node, 165); - } - if (token() === 130 || token() === 10) { + if (token() === 129 || token() === 10) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -19495,10 +19511,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 215); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 214); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246); + return parseClassDeclarationOrExpression(node, 245); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -19532,14 +19548,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 || tok === 113); - var node = createNode(280); + var node = createNode(279); node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217); + var node = createNode(216); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -19555,7 +19571,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247; + node.kind = 246; parseExpected(114); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -19564,8 +19580,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248; - parseExpected(146); + node.kind = 247; + parseExpected(145); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62); @@ -19574,13 +19590,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNodeWithJSDoc(285); + var node = createNodeWithJSDoc(284); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249; + node.kind = 248; parseExpected(88); node.name = parseIdentifier(); if (parseExpected(18)) { @@ -19593,7 +19609,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251); + var node = createNode(250); if (parseExpected(18)) { node.statements = parseList(1, parseStatement); parseExpected(19); @@ -19604,7 +19620,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250; + node.kind = 249; var namespaceFlag = flags & 16; node.flags |= flags; node.name = parseIdentifier(); @@ -19614,8 +19630,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250; - if (token() === 151) { + node.kind = 249; + if (token() === 150) { node.name = parseIdentifier(); node.flags |= 1024; } @@ -19633,14 +19649,14 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151) { + if (token() === 150) { return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137)) { + else if (parseOptional(136)) { flags |= 16; } else { - parseExpected(136); + parseExpected(135); if (token() === 10) { return parseAmbientExternalModuleDeclaration(node); } @@ -19648,7 +19664,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 && + return token() === 139 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -19658,9 +19674,9 @@ var ts; return nextToken() === 43; } function parseNamespaceExportDeclaration(node) { - node.kind = 253; + node.kind = 252; parseExpected(123); - parseExpected(137); + parseExpected(136); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -19673,7 +19689,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 && + if (token() !== 149 && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -19682,12 +19698,12 @@ var ts; if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } - node.kind = 255; + node.kind = 254; if (identifier || token() === 41 || token() === 18) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150); + parseExpected(149); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -19697,10 +19713,10 @@ var ts; return token() === 41 || token() === 18; } function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { - return token() === 27 || token() === 150; + return token() === 27 || token() === 149; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254; + node.kind = 253; node.name = identifier; parseExpected(62); node.moduleReference = parseModuleReference(); @@ -19712,14 +19728,14 @@ var ts; return finished; } function parseImportClause(identifier, fullStart, isTypeOnly) { - var importClause = createNode(256, fullStart); + var importClause = createNode(255, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(27)) { - importClause.namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(258); + importClause.namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(257); } return finishNode(importClause); } @@ -19729,8 +19745,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(266); - parseExpected(140); + var node = createNode(265); + parseExpected(139); parseExpected(20); node.expression = parseModuleSpecifier(); parseExpected(21); @@ -19747,7 +19763,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(257); + var namespaceImport = createNode(256); parseExpected(41); parseExpected(123); namespaceImport.name = parseIdentifier(); @@ -19755,14 +19771,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(23, kind === 258 ? parseImportSpecifier : parseExportSpecifier, 18, 19); + node.elements = parseBracketedList(23, kind === 257 ? parseImportSpecifier : parseExportSpecifier, 18, 19); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264); + return parseImportOrExportSpecifier(263); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259); + return parseImportOrExportSpecifier(258); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -19781,31 +19797,31 @@ var ts; else { node.name = identifierName; } - if (kind === 259 && checkIdentifierIsKeyword) { + if (kind === 258 && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263, pos); + var node = createNode(262, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261; - node.isTypeOnly = parseOptional(146); + node.kind = 260; + node.isTypeOnly = parseOptional(145); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41)) { if (parseOptional(123)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150); + parseExpected(149); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262); - if (token() === 150 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { - parseExpected(150); + node.exportClause = parseNamedImportsOrExports(261); + if (token() === 149 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { + parseExpected(149); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -19813,7 +19829,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260; + node.kind = 259; if (parseOptional(62)) { node.isExportEquals = true; } @@ -19831,10 +19847,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89) - || node.kind === 254 && node.moduleReference.kind === 266 - || node.kind === 255 - || node.kind === 260 - || node.kind === 261 ? node : undefined; + || node.kind === 253 && node.moduleReference.kind === 265 + || node.kind === 254 + || node.kind === 259 + || node.kind === 260 ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 ? @@ -19864,7 +19880,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295); + var result = createNode(294); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18); result.type = doInsideOfContext(4194304, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -20000,7 +20016,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304, start); + var result = createNode(303, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -20069,19 +20085,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311, tagName); + tag = parseSimpleTag(start, 310, tagName); break; case "public": - tag = parseSimpleTag(start, 312, tagName); + tag = parseSimpleTag(start, 311, tagName); break; case "private": - tag = parseSimpleTag(start, 313, tagName); + tag = parseSimpleTag(start, 312, tagName); break; case "protected": - tag = parseSimpleTag(start, 314, tagName); + tag = parseSimpleTag(start, 313, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315, tagName); + tag = parseSimpleTag(start, 314, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -20207,7 +20223,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307, start); + var result = createNode(306, start); result.tagName = tagName; return finishNode(result); } @@ -20249,9 +20265,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142: + case 141: return true; - case 175: + case 174: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -20267,8 +20283,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 ? - createNode(324, start) : - createNode(318, start); + createNode(323, start) : + createNode(317, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -20285,20 +20301,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 || child.kind === 324) { + if (child.kind === 317 || child.kind === 323) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305, start_3); + jsdocTypeLiteral = createNode(304, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175) { + if (typeExpression.type.kind === 174) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -20310,7 +20326,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319, start); + var result = createNode(318, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -20319,13 +20335,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321, start); + var result = createNode(320, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310, start); + var result = createNode(309, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -20379,20 +20395,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309, start); + var result = createNode(308, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308, start); + var result = createNode(307, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18); - var node = createNode(217); + var node = createNode(216); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -20404,7 +20420,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24)) { - var prop = createNode(195, node.pos); + var prop = createNode(194, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -20417,14 +20433,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320, start); + var tag = createNode(319, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317, start); + var tag = createNode(316, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(true); skipWhitespace(); @@ -20433,7 +20449,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323, start); + var typedefTag = createNode(322, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -20447,9 +20463,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305, start); + jsdocTypeLiteral = createNode(304, start); } - if (child.kind === 321) { + if (child.kind === 320) { if (childTypeTag) { break; } @@ -20462,7 +20478,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175) { + if (typeExpression && typeExpression.type.kind === 174) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -20480,7 +20496,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24)) { - var jsDocNamespaceNode = createNode(250, pos); + var jsDocNamespaceNode = createNode(249, pos); if (nested) { jsDocNamespaceNode.flags |= 4; } @@ -20494,14 +20510,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316, start); + var callbackTag = createNode(315, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306, start); + var jsdocSignature = createNode(305, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -20509,7 +20525,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59)) { var tag = parseTag(indent); - if (tag && tag.kind === 319) { + if (tag && tag.kind === 318) { return tag; } } @@ -20554,7 +20570,7 @@ var ts; case 59: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 || child.kind === 324) && + if (child && (child.kind === 317 || child.kind === 323) && target !== 4 && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -20617,13 +20633,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156); + var typeParameter = createNode(155); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27)); - var result = createNode(322, start); + var result = createNode(321, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -22631,7 +22647,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282) { + if (element.kind !== 281) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -22715,13 +22731,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208: + case 207: if (valueExpression.operator !== 40 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194: + case 193: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -22731,7 +22747,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 193: + case 192: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -24759,23 +24775,23 @@ var ts; } function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { + case 246: case 247: - case 248: return 0; - case 249: + case 248: if (ts.isEnumConst(node)) { return 2; } break; - case 255: case 254: + case 253: if (!(ts.hasModifier(node, 1))) { return 0; } break; - case 261: + case 260: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261) { var state = 0; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -24790,7 +24806,7 @@ var ts; return state; } break; - case 251: { + case 250: { var state_1 = 0; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -24809,7 +24825,7 @@ var ts; }); return state_1; } - case 250: + case 249: return getModuleInstanceState(node, visited); case 75: if (node.isInJSDocNamespace) { @@ -24973,7 +24989,7 @@ var ts; } } function getDeclarationName(node) { - if (node.kind === 260) { + if (node.kind === 259) { return node.isExportEquals ? "export=" : "default"; } var name = ts.getNameOfDeclaration(node); @@ -24982,7 +24998,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155) { + if (name.kind === 154) { var nameExpression = name.expression; if (ts.isStringOrNumericLiteralLike(nameExpression)) { return ts.escapeLeadingUnderscores(nameExpression.text); @@ -25007,31 +25023,31 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163: + case 162: return "__constructor"; + case 170: + case 165: + case 305: + return "__call"; case 171: case 166: - case 306: - return "__call"; - case 172: - case 167: return "__new"; - case 168: + case 167: return "__index"; - case 261: + case 260: return "__export"; - case 291: + case 290: return "export="; - case 210: + case 209: if (ts.getAssignmentDeclarationKind(node) === 2) { return "export="; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301: + case 300: return (ts.isJSDocConstructSignature(node) ? "__new" : "__call"); - case 157: - ts.Debug.assert(node.parent.kind === 301, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + case 156: + ts.Debug.assert(node.parent.kind === 300, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -25086,7 +25102,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 && !node.isExportEquals)) { + (node.kind === 259 && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -25124,7 +25140,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 2097152) { - if (node.kind === 264 || (node.kind === 254 && hasExportModifier)) { + if (node.kind === 263 || (node.kind === 253 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -25154,7 +25170,7 @@ var ts; var saveThisParentContainer = thisParentContainer; var savedBlockScopeContainer = blockScopeContainer; if (containerFlags & 1) { - if (node.kind !== 203) { + if (node.kind !== 202) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -25183,7 +25199,7 @@ var ts; currentFlow.node = node; } } - currentReturnTarget = isIIFE || node.kind === 163 ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -25197,13 +25213,13 @@ var ts; node.flags |= 512; node.endFlowNode = currentFlow; } - if (node.kind === 291) { + if (node.kind === 290) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163) { + if (node.kind === 162) { node.returnFlowNode = currentFlow; } } @@ -25247,8 +25263,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -25280,89 +25296,92 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 && node.kind <= 242 && !options.allowUnreachableCode) { + if (node.kind >= 225 && node.kind <= 241 && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230: + case 229: bindWhileStatement(node); break; - case 229: + case 228: bindDoStatement(node); break; - case 231: + case 230: bindForStatement(node); break; + case 231: case 232: - case 233: bindForInOrForOfStatement(node); break; - case 228: + case 227: bindIfStatement(node); break; - case 236: - case 240: + case 235: + case 239: bindReturnOrThrow(node); break; - case 235: case 234: + case 233: bindBreakOrContinueStatement(node); break; - case 241: + case 240: bindTryStatement(node); break; - case 238: + case 237: bindSwitchStatement(node); break; - case 252: + case 251: bindCaseBlock(node); break; - case 278: + case 277: bindCaseClause(node); break; - case 227: + case 226: bindExpressionStatement(node); break; - case 239: + case 238: bindLabeledStatement(node); break; - case 208: + case 207: bindPrefixUnaryExpressionFlow(node); break; - case 209: + case 208: bindPostfixUnaryExpressionFlow(node); break; - case 210: + case 209: bindBinaryExpressionFlow(node); break; - case 204: + case 203: bindDeleteExpressionFlow(node); break; - case 211: + case 210: bindConditionalExpressionFlow(node); break; - case 243: + case 242: bindVariableDeclarationFlow(node); break; + case 194: case 195: - case 196: bindAccessExpressionFlow(node); break; - case 197: + case 196: bindCallExpressionFlow(node); break; - case 323: + case 218: + bindNonNullExpressionFlow(node); + break; + case 322: + case 315: case 316: - case 317: bindJSDocTypeAlias(node); break; - case 291: { + case 290: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224: - case 251: + case 223: + case 250: bindEachFunctionsFirst(node.statements); break; default: @@ -25375,18 +25394,18 @@ var ts; switch (expr.kind) { case 75: case 104: + case 194: case 195: - case 196: return containsNarrowableReference(expr); - case 197: + case 196: return hasNarrowableArgument(expr); - case 201: + case 200: return isNarrowingExpression(expr.expression); - case 210: + case 209: return isNarrowingBinaryExpression(expr); - case 208: + case 207: return expr.operator === 53 && isNarrowingExpression(expr.operand); - case 205: + case 204: return isNarrowingExpression(expr.expression); } return false; @@ -25408,7 +25427,7 @@ var ts; } } } - if (expr.expression.kind === 195 && + if (expr.expression.kind === 194 && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -25441,9 +25460,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201: + case 200: return isNarrowableOperand(expr.expression); - case 210: + case 209: switch (expr.operatorToken.kind) { case 62: return isNarrowableOperand(expr.left); @@ -25518,26 +25537,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228: - case 230: + case 227: case 229: + case 228: return parent.expression === node; - case 231: - case 211: + case 230: + case 210: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201) { + if (node.kind === 200) { node = node.expression; } - else if (node.kind === 208 && node.operator === 53) { + else if (node.kind === 207 && node.operator === 53) { node = node.operand; } else { - return node.kind === 210 && (node.operatorToken.kind === 55 || + return node.kind === 209 && (node.operatorToken.kind === 55 || node.operatorToken.kind === 56 || node.operatorToken.kind === 60); } @@ -25579,7 +25598,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239) { + while (label && node.parent.kind === 238) { label.continueTarget = target; label = label.next; node = node.parent; @@ -25630,12 +25649,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233) { + if (node.kind === 232) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244) { + if (node.initializer.kind !== 243) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -25657,7 +25676,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236) { + if (node.kind === 235) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -25674,7 +25693,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -25744,7 +25763,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -25788,7 +25807,7 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - if (node.expression.kind === 197) { + if (node.expression.kind === 196) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -25814,7 +25833,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 && node.operatorToken.kind === 62) { + if (node.kind === 209 && node.operatorToken.kind === 62) { bindAssignmentTargetFlow(node.left); } else { @@ -25825,10 +25844,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16, currentFlow, node); } - else if (node.kind === 193) { + else if (node.kind === 192) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214) { + if (e.kind === 213) { bindAssignmentTargetFlow(e.expression); } else { @@ -25836,16 +25855,16 @@ var ts; } } } - else if (node.kind === 194) { + else if (node.kind === 193) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282) { + if (p.kind === 281) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283) { + else if (p.kind === 282) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284) { + else if (p.kind === 283) { bindAssignmentTargetFlow(p.expression); } } @@ -25951,7 +25970,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 && node.left.kind === 196) { + if (operator === 62 && node.left.kind === 195) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -26006,7 +26025,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195) { + if (node.expression.kind === 194) { bindAssignmentTargetFlow(node.expression); } } @@ -26045,14 +26064,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 && node.fullName) { + if (node.kind !== 316 && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162) { + if (host && host.kind !== 161) { addDeclarationToSymbol(host.symbol, host, 32); } } @@ -26064,22 +26083,24 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195: + case 194: + bind(node.questionDotToken); bind(node.name); break; - case 196: + case 195: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197: + case 196: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; } } function bindOptionalChain(node, trueTarget, falseTarget) { - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -26100,6 +26121,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -26114,7 +26143,7 @@ var ts; } else { var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 || expr.kind === 203) { + if (expr.kind === 201 || expr.kind === 202) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -26123,7 +26152,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195) { + if (node.expression.kind === 194) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -26132,53 +26161,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215: - case 246: - case 249: - case 194: - case 174: - case 305: - case 275: - return 1; - case 247: - return 1 | 64; - case 250: + case 214: + case 245: case 248: - case 187: + case 193: + case 173: + case 304: + case 274: + return 1; + case 246: + return 1 | 64; + case 249: + case 247: + case 186: return 1 | 32; - case 291: + case 290: return 1 | 4 | 32; - case 162: + case 161: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } + case 162: + case 244: + case 160: case 163: - case 245: - case 161: case 164: case 165: + case 305: + case 300: + case 170: case 166: - case 306: - case 301: - case 171: case 167: - case 168: - case 172: + case 171: return 1 | 4 | 32 | 8; + case 201: case 202: - case 203: return 1 | 4 | 32 | 8 | 16; - case 251: + case 250: return 4; - case 160: + case 159: return node.initializer ? 4 : 0; - case 281: + case 280: + case 230: case 231: case 232: - case 233: - case 252: + case 251: return 2; - case 224: + case 223: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -26191,40 +26220,40 @@ var ts; } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 250: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215: - case 246: - return declareClassMember(node, symbolFlags, symbolExcludes); case 249: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 290: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 214: + case 245: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 248: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174: - case 305: - case 194: - case 247: - case 275: + case 173: + case 304: + case 193: + case 246: + case 274: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 170: case 171: - case 172: + case 165: case 166: + case 305: case 167: - case 306: - case 168: - case 162: case 161: + case 160: + case 162: case 163: case 164: - case 165: - case 245: + case 244: + case 201: case 202: - case 203: - case 301: - case 323: - case 316: - case 248: - case 187: + case 300: + case 322: + case 315: + case 247: + case 186: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -26303,11 +26332,11 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 || prop.name.kind !== 75) { + if (prop.kind === 283 || prop.name.kind !== 75) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 282 || prop.kind === 283 || prop.kind === 162 + var currentKind = prop.kind === 281 || prop.kind === 282 || prop.kind === 161 ? 1 : 2; var existingKind = seen.get(identifier.escapedText); @@ -26339,10 +26368,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250: + case 249: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291: + case 290: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -26503,8 +26532,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 291 && - blockScopeContainer.kind !== 250 && + if (blockScopeContainer.kind !== 290 && + blockScopeContainer.kind !== 249 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -26566,7 +26595,7 @@ var ts; node.parent = parent; var saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 153) { + if (node.kind > 152) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -26634,14 +26663,14 @@ var ts; break; } case 104: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76: return checkPrivateIdentifier(node); + case 194: case 195: - case 196: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -26656,7 +26685,7 @@ var ts; declareSymbol(file.locals, undefined, expr.expression, 1 | 134217728, 111550); } break; - case 210: + case 209: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1: @@ -26683,74 +26712,74 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281: + case 280: return checkStrictModeCatchClause(node); - case 204: + case 203: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 209: - return checkStrictModePostfixUnaryExpression(node); case 208: + return checkStrictModePostfixUnaryExpression(node); + case 207: return checkStrictModePrefixUnaryExpression(node); - case 237: + case 236: return checkStrictModeWithStatement(node); - case 239: + case 238: return checkStrictModeLabeledStatement(node); - case 184: + case 183: seenThisKeyword = true; return; - case 169: + case 168: break; - case 156: + case 155: return bindTypeParameter(node); - case 157: + case 156: return bindParameter(node); - case 243: + case 242: return bindVariableDeclarationOrBindingElement(node); - case 192: + case 191: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160: case 159: + case 158: return bindPropertyWorker(node); + case 281: case 282: - case 283: return bindPropertyOrMethodOrAccessor(node, 4, 0); - case 285: + case 284: return bindPropertyOrMethodOrAccessor(node, 8, 900095); + case 165: case 166: case 167: - case 168: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 162: case 161: + case 160: return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 103359); - case 245: + case 244: return bindFunctionDeclaration(node); - case 163: + case 162: return declareSymbolAndAddToSymbolTable(node, 16384, 0); - case 164: + case 163: return bindPropertyOrMethodOrAccessor(node, 32768, 46015); - case 165: + case 164: return bindPropertyOrMethodOrAccessor(node, 65536, 78783); - case 171: - case 301: - case 306: - case 172: - return bindFunctionOrConstructorType(node); - case 174: + case 170: + case 300: case 305: - case 187: + case 171: + return bindFunctionOrConstructorType(node); + case 173: + case 304: + case 186: return bindAnonymousTypeWorker(node); - case 311: + case 310: return bindJSDocClassTag(node); - case 194: + case 193: return bindObjectLiteralExpression(node); + case 201: case 202: - case 203: return bindFunctionExpression(node); - case 197: + case 196: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7: @@ -26768,60 +26797,60 @@ var ts; bindCallExpression(node); } break; - case 215: - case 246: + case 214: + case 245: inStrictMode = true; return bindClassLikeDeclaration(node); - case 247: + case 246: return bindBlockScopedDeclaration(node, 64, 788872); - case 248: + case 247: return bindBlockScopedDeclaration(node, 524288, 788968); - case 249: + case 248: return bindEnumDeclaration(node); - case 250: + case 249: return bindModuleDeclaration(node); - case 275: - return bindJsxAttributes(node); case 274: + return bindJsxAttributes(node); + case 273: return bindJsxAttribute(node, 4, 0); - case 254: - case 257: - case 259: - case 264: - return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); case 253: - return bindNamespaceExportDeclaration(node); case 256: + case 258: + case 263: + return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + case 252: + return bindNamespaceExportDeclaration(node); + case 255: return bindImportClause(node); - case 261: - return bindExportDeclaration(node); case 260: + return bindExportDeclaration(node); + case 259: return bindExportAssignment(node); - case 291: + case 290: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224: + case 223: if (!ts.isFunctionLike(node.parent)) { return; } - case 251: + case 250: return updateStrictModeStatementList(node.statements); - case 318: - if (node.parent.kind === 306) { + case 317: + if (node.parent.kind === 305) { return bindParameter(node); } - if (node.parent.kind !== 305) { + if (node.parent.kind !== 304) { break; } - case 324: + case 323: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 ? 4 | 16777216 : 4; return declareSymbolAndAddToSymbolTable(propTag, flags, 0); - case 323: + case 322: + case 315: case 316: - case 317: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -26958,8 +26987,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, false); switch (thisContainer.kind) { - case 245: - case 202: + case 244: + case 201: var constructorSymbol = thisContainer.symbol; if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62) { var l = thisContainer.parent.left; @@ -26978,11 +27007,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32); } break; - case 163: - case 160: case 162: + case 159: + case 161: + case 163: case 164: - case 165: var containingClass = thisContainer.parent; var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members; if (ts.hasDynamicName(node)) { @@ -26992,7 +27021,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 | 67108864, 0, true); } break; - case 291: + case 290: if (ts.hasDynamicName(node)) { break; } @@ -27021,7 +27050,7 @@ var ts; if (node.expression.kind === 104) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -27052,7 +27081,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291; + var isToplevel = node.parent.parent.kind === 290; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false); } @@ -27139,8 +27168,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 - : propertyAccess.parent.parent.kind === 291; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 + : propertyAccess.parent.parent.kind === 290; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -27206,7 +27235,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246) { + if (node.kind === 245) { bindBlockScopedDeclaration(node, 32, 899503); } else { @@ -27250,7 +27279,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 && container.kind !== 306) { + if (node.kind === 317 && container.kind !== 305) { return; } if (inStrictMode && !(node.flags & 8388608)) { @@ -27323,7 +27352,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144, 526824); } } - else if (node.parent.kind === 182) { + else if (node.parent.kind === 181) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -27348,9 +27377,9 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 225) || - node.kind === 246 || - (node.kind === 250 && shouldReportErrorOnModuleDeclaration(node)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 224) || + node.kind === 245 || + (node.kind === 249 && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -27382,12 +27411,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { + case 246: case 247: - case 248: return true; - case 250: - return getModuleInstanceState(s) !== 1; case 249: + return getModuleInstanceState(s) !== 1; + case 248: return ts.hasModifier(s, 2048); default: return false; @@ -27430,58 +27459,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197: - return computeCallExpression(node, subtreeFlags); - case 198: - return computeNewExpression(node, subtreeFlags); - case 250: - return computeModuleDeclaration(node, subtreeFlags); - case 201: - return computeParenthesizedExpression(node, subtreeFlags); - case 210: - return computeBinaryExpression(node, subtreeFlags); - case 227: - return computeExpressionStatement(node, subtreeFlags); - case 157: - return computeParameter(node, subtreeFlags); - case 203: - return computeArrowFunction(node, subtreeFlags); - case 202: - return computeFunctionExpression(node, subtreeFlags); - case 245: - return computeFunctionDeclaration(node, subtreeFlags); - case 243: - return computeVariableDeclaration(node, subtreeFlags); - case 244: - return computeVariableDeclarationList(node, subtreeFlags); - case 226: - return computeVariableStatement(node, subtreeFlags); - case 239: - return computeLabeledStatement(node, subtreeFlags); - case 246: - return computeClassDeclaration(node, subtreeFlags); - case 215: - return computeClassExpression(node, subtreeFlags); - case 280: - return computeHeritageClause(node, subtreeFlags); - case 281: - return computeCatchClause(node, subtreeFlags); - case 217: - return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163: - return computeConstructor(node, subtreeFlags); - case 160: - return computePropertyDeclaration(node, subtreeFlags); - case 162: - return computeMethod(node, subtreeFlags); - case 164: - case 165: - return computeAccessor(node, subtreeFlags); - case 254: - return computeImportEquals(node, subtreeFlags); - case 195: - return computePropertyAccess(node, subtreeFlags); case 196: + return computeCallExpression(node, subtreeFlags); + case 197: + return computeNewExpression(node, subtreeFlags); + case 249: + return computeModuleDeclaration(node, subtreeFlags); + case 200: + return computeParenthesizedExpression(node, subtreeFlags); + case 209: + return computeBinaryExpression(node, subtreeFlags); + case 226: + return computeExpressionStatement(node, subtreeFlags); + case 156: + return computeParameter(node, subtreeFlags); + case 202: + return computeArrowFunction(node, subtreeFlags); + case 201: + return computeFunctionExpression(node, subtreeFlags); + case 244: + return computeFunctionDeclaration(node, subtreeFlags); + case 242: + return computeVariableDeclaration(node, subtreeFlags); + case 243: + return computeVariableDeclarationList(node, subtreeFlags); + case 225: + return computeVariableStatement(node, subtreeFlags); + case 238: + return computeLabeledStatement(node, subtreeFlags); + case 245: + return computeClassDeclaration(node, subtreeFlags); + case 214: + return computeClassExpression(node, subtreeFlags); + case 279: + return computeHeritageClause(node, subtreeFlags); + case 280: + return computeCatchClause(node, subtreeFlags); + case 216: + return computeExpressionWithTypeArguments(node, subtreeFlags); + case 162: + return computeConstructor(node, subtreeFlags); + case 159: + return computePropertyDeclaration(node, subtreeFlags); + case 161: + return computeMethod(node, subtreeFlags); + case 163: + case 164: + return computeAccessor(node, subtreeFlags); + case 253: + return computeImportEquals(node, subtreeFlags); + case 194: + return computePropertyAccess(node, subtreeFlags); + case 195: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -27528,10 +27557,10 @@ var ts; if (operatorTokenKind === 60) { transformFlags |= 8; } - else if (operatorTokenKind === 62 && leftKind === 194) { + else if (operatorTokenKind === 62 && leftKind === 193) { transformFlags |= 32 | 256 | 1024; } - else if (operatorTokenKind === 62 && leftKind === 193) { + else if (operatorTokenKind === 62 && leftKind === 192) { transformFlags |= 256 | 1024; } else if (operatorTokenKind === 42 @@ -27568,8 +27597,8 @@ var ts; var transformFlags = subtreeFlags; var expression = node.expression; var expressionKind = expression.kind; - if (expressionKind === 218 - || expressionKind === 200) { + if (expressionKind === 217 + || expressionKind === 199) { transformFlags |= 1; } node.transformFlags = transformFlags | 536870912; @@ -27853,12 +27882,12 @@ var ts; case 126: transformFlags |= 32 | 64; break; - case 207: + case 206: transformFlags |= 32 | 64 | 524288; break; - case 200: - case 218: - case 327: + case 199: + case 217: + case 326: transformFlags |= 1; excludeFlags = 536870912; break; @@ -27866,18 +27895,19 @@ var ts; case 117: case 118: case 122: - case 131: + case 130: case 81: - case 249: - case 285: - case 219: - case 139: + case 248: + case 284: + case 218: + case 138: transformFlags |= 1; break; + case 266: case 267: case 268: - case 269: case 11: + case 269: case 270: case 271: case 272: @@ -27885,7 +27915,6 @@ var ts; case 274: case 275: case 276: - case 277: transformFlags |= 2; break; case 14: @@ -27896,15 +27925,15 @@ var ts; transformFlags |= 32; break; } - case 199: + case 198: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32; break; } - case 212: - case 283: + case 211: + case 282: case 120: - case 220: + case 219: transformFlags |= 256; break; case 10: @@ -27920,27 +27949,28 @@ var ts; case 9: transformFlags |= 4; break; - case 233: + case 232: if (node.awaitModifier) { transformFlags |= 32; } transformFlags |= 256; break; - case 213: + case 212: transformFlags |= 32 | 256 | 262144; break; case 125: + case 140: + case 151: + case 137: case 141: - case 152: - case 138: - case 142: + case 143: + case 128: case 144: - case 129: - case 145: case 110: - case 156: - case 159: - case 161: + case 155: + case 158: + case 160: + case 165: case 166: case 167: case 168: @@ -27958,25 +27988,24 @@ var ts; case 180: case 181: case 182: - case 183: + case 246: case 247: - case 248: + case 183: case 184: case 185: case 186: case 187: - case 188: - case 253: + case 252: transformFlags = 1; excludeFlags = -2; break; - case 155: + case 154: transformFlags |= 32768; break; - case 214: + case 213: transformFlags |= 256 | 8192; break; - case 284: + case 283: transformFlags |= 32 | 16384; break; case 102: @@ -27986,27 +28015,27 @@ var ts; case 104: transformFlags |= 4096; break; - case 190: + case 189: transformFlags |= 256 | 131072; if (subtreeFlags & 8192) { transformFlags |= 32 | 16384; } excludeFlags = 536879104; break; - case 191: + case 190: transformFlags |= 256 | 131072; excludeFlags = 536879104; break; - case 192: + case 191: transformFlags |= 256; if (node.dotDotDotToken) { transformFlags |= 8192; } break; - case 158: + case 157: transformFlags |= 1 | 2048; break; - case 194: + case 193: excludeFlags = 536922112; if (subtreeFlags & 32768) { transformFlags |= 256; @@ -28015,27 +28044,27 @@ var ts; transformFlags |= 32; } break; - case 193: + case 192: excludeFlags = 536879104; break; + case 228: case 229: case 230: case 231: - case 232: if (subtreeFlags & 65536) { transformFlags |= 256; } break; - case 291: + case 290: break; - case 263: + case 262: transformFlags |= 4; break; - case 236: + case 235: transformFlags |= 1048576 | 32; break; + case 233: case 234: - case 235: transformFlags |= 1048576; break; case 76: @@ -28049,67 +28078,67 @@ var ts; return transformFlags | (node.transformFlags & 4096); } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 && kind <= 189) { + if (kind >= 168 && kind <= 188) { return -2; } switch (kind) { + case 196: case 197: - case 198: - case 193: + case 192: return 536879104; - case 250: + case 249: return 537991168; - case 157: + case 156: return 536870912; - case 203: - return 538920960; case 202: - case 245: - return 538925056; + return 538920960; + case 201: case 244: + return 538925056; + case 243: return 537018368; - case 246: - case 215: + case 245: + case 214: return 536905728; - case 163: - return 538923008; case 162: + return 538923008; + case 161: + case 163: case 164: - case 165: return 538923008; case 125: + case 140: + case 151: + case 137: + case 143: case 141: - case 152: - case 138: + case 128: case 144: - case 142: - case 129: - case 145: case 110: - case 156: - case 159: - case 161: + case 155: + case 158: + case 160: + case 165: case 166: case 167: - case 168: + case 246: case 247: - case 248: return -2; - case 194: + case 193: return 536922112; - case 281: + case 280: return 536887296; + case 189: case 190: - case 191: return 536879104; + case 199: + case 217: + case 326: case 200: - case 218: - case 327: - case 201: case 102: return 536870912; + case 194: case 195: - case 196: return 536870912; default: return 536870912; @@ -28271,7 +28300,7 @@ var ts; symbol.exports.forEach(visitSymbol); } ts.forEach(symbol.declarations, function (d) { - if (d.type && d.type.kind === 173) { + if (d.type && d.type.kind === 172) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -28703,7 +28732,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4, "unknown"); @@ -29227,7 +29255,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -29273,15 +29301,15 @@ var ts; return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { - if (declaration.kind === 192) { - var errorBindingElement = ts.getAncestor(usage, 192); + if (declaration.kind === 191) { + var errorBindingElement = ts.getAncestor(usage, 191); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242), usage); } - else if (declaration.kind === 243) { + else if (declaration.kind === 242) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } else if (ts.isClassDeclaration(declaration)) { @@ -29298,10 +29326,10 @@ var ts; } return true; } - if (usage.parent.kind === 264 || (usage.parent.kind === 260 && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 || (usage.parent.kind === 259 && usage.parent.isExportEquals)) { return true; } - if (usage.kind === 260 && usage.isExportEquals) { + if (usage.kind === 259 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -29321,9 +29349,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226: - case 231: - case 233: + case 225: + case 230: + case 232: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } @@ -29341,16 +29369,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 && + current.parent.kind === 159 && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32)) { - if (declaration.kind === 162) { + if (declaration.kind === 161) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 && !ts.hasModifier(declaration, 32); + var isDeclarationInstanceProperty = declaration.kind === 159 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -29368,18 +29396,18 @@ var ts; return "quit"; } switch (node.kind) { - case 203: + case 202: return true; - case 160: + case 159: return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224: + case 223: switch (node.parent.kind) { + case 163: + case 161: case 164: - case 162: - case 165: return true; default: return false; @@ -29411,11 +29439,11 @@ var ts; if (result = lookup(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 && lastLocation.kind !== 304) { + if (meaning & result.flags & 788968 && lastLocation.kind !== 303) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 157 || - lastLocation.kind === 156 + lastLocation.kind === 156 || + lastLocation.kind === 155 : false; } if (meaning & result.flags & 3) { @@ -29426,13 +29454,13 @@ var ts; } else if (result.flags & 1) { useResult = - lastLocation.kind === 157 || + lastLocation.kind === 156 || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181) { + else if (location.kind === 180) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -29445,13 +29473,13 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291: + case 290: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 250: + case 249: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { @@ -29462,7 +29490,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 && - (ts.getDeclarationOfKind(moduleExport, 264) || ts.getDeclarationOfKind(moduleExport, 263))) { + (ts.getDeclarationOfKind(moduleExport, 263) || ts.getDeclarationOfKind(moduleExport, 262))) { break; } } @@ -29475,12 +29503,12 @@ var ts; } } break; - case 249: + case 248: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 160: + case 159: if (!ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -29490,9 +29518,9 @@ var ts; } } break; + case 245: + case 214: case 246: - case 215: - case 247: if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = undefined; @@ -29504,7 +29532,7 @@ var ts; } break loop; } - if (location.kind === 215 && meaning & 32) { + if (location.kind === 214 && meaning & 32) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -29512,7 +29540,7 @@ var ts; } } break; - case 217: + case 216: if (lastLocation === location.expression && location.parent.token === 90) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968))) { @@ -29523,30 +29551,30 @@ var ts; } } break; - case 155: + case 154: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246) { if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 203: + case 202: if (compilerOptions.target >= 2) { break; } + case 161: case 162: case 163: case 164: - case 165: - case 245: + case 244: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202: + case 201: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -29559,28 +29587,28 @@ var ts; } } break; - case 158: - if (location.parent && location.parent.kind === 157) { + case 157: + if (location.parent && location.parent.kind === 156) { location = location.parent; } - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245)) { location = location.parent; } break; - case 323: + case 322: + case 315: case 316: - case 317: location = ts.getJSDocHost(location); break; - case 157: + case 156: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192: + case 191: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157) { + if (root.kind === 156) { associatedDeclarationForContainingInitializer = location; } } @@ -29597,7 +29625,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291); + ts.Debug.assert(lastLocation.kind === 290); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -29695,9 +29723,9 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 && location.kind !== 202) { + if (location.kind !== 202 && location.kind !== 201) { return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 && !ts.hasModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); + (location.kind === 159 && !ts.hasModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); } if (lastLocation && lastLocation === location.name) { return false; @@ -29709,12 +29737,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { + case 244: case 245: case 246: + case 248: case 247: case 249: - case 248: - case 250: return true; default: return false; @@ -29726,7 +29754,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156) { + if (decl.kind === 155) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); @@ -29775,9 +29803,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75: - case 195: + case 194: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217: + case 216: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -29820,7 +29848,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -29877,7 +29905,7 @@ var ts; if (result.flags & (16 | 1 | 67108864) && result.flags & 32) { return; } - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -29908,13 +29936,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254: + case 253: return node; - case 256: + case 255: return node.parent; - case 257: + case 256: return node.parent.parent; - case 259: + case 258: return node.parent.parent.parent; default: return undefined; @@ -29924,28 +29952,28 @@ var ts; return ts.find(symbol.declarations, isAliasSymbolDeclaration); } function isAliasSymbolDeclaration(node) { - return node.kind === 254 || - node.kind === 253 || - node.kind === 256 && !!node.name || - node.kind === 257 || + return node.kind === 253 || + node.kind === 252 || + node.kind === 255 && !!node.name || + node.kind === 256 || + node.kind === 262 || + node.kind === 258 || node.kind === 263 || - node.kind === 259 || - node.kind === 264 || - node.kind === 260 && ts.exportAssignmentIsAlias(node) || + node.kind === 259 && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 || - node.kind === 282 && isAliasableOrJsExpression(node.initializer); + node.kind === 282 || + node.kind === 281 && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266) { + if (node.moduleReference.kind === 265) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, false); @@ -30212,28 +30240,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254: - return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256: - return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257: - return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263: - return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259: - return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264: - return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); - case 260: - case 210: - return getTargetOfExportAssignment(node, dontRecursivelyResolve); case 253: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 255: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 256: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 262: + return getTargetOfNamespaceExport(node, dontRecursivelyResolve); + case 258: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 263: + return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); + case 259: + case 209: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 252: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283: - return resolveEntityName(node.name, 111551 | 788968 | 1920, true, dontRecursivelyResolve); case 282: + return resolveEntityName(node.name, 111551 | 788968 | 1920, true, dontRecursivelyResolve); + case 281: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195: + case 194: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -30341,11 +30369,11 @@ var ts; if (entityName.kind === 75 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 75 || entityName.parent.kind === 154) { + if (entityName.kind === 75 || entityName.parent.kind === 153) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 254); + ts.Debug.assert(entityName.parent.kind === 253); return resolveEntityName(entityName, 111551 | 788968 | 1920, false, dontResolveAlias); } } @@ -30366,9 +30394,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 || name.kind === 195) { - var left = name.kind === 154 ? name.left : name.expression; - var right = name.kind === 154 ? name.right : name.name; + else if (name.kind === 153 || name.kind === 194) { + var left = name.kind === 153 ? name.left : name.expression; + var right = name.kind === 153 ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -30403,7 +30431,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 260)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 259)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, undefined, true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -30597,7 +30625,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 291)) { + if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 290)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -30861,7 +30889,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 && ts.nodeIsPresent(member.body)) { return member; } } @@ -30943,19 +30971,19 @@ var ts; } } switch (location.kind) { - case 291: + case 290: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 250: + case 249: var sym = getSymbolOfNode(location); if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols)) { return { value: result }; } break; + case 245: + case 214: case 246: - case 215: - case 247: var table_1; (getSymbolOfNode(location).members || emptySymbols).forEach(function (memberSymbol, key) { if (memberSymbol.flags & (788968 & ~67108864)) { @@ -31016,7 +31044,7 @@ var ts; && symbolFromSymbolTable.escapedName !== "default" && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -31052,7 +31080,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -31066,10 +31094,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160: - case 162: + case 159: + case 161: + case 163: case 164: - case 165: continue; default: return false; @@ -31167,10 +31195,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -31210,13 +31238,13 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 173 || + if (entityName.parent.kind === 172 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155) { + entityName.parent.kind === 154) { meaning = 111551 | 1048576; } - else if (entityName.kind === 154 || entityName.kind === 195 || - entityName.parent.kind === 254) { + else if (entityName.kind === 153 || entityName.kind === 194 || + entityName.parent.kind === 253) { meaning = 1920; } else { @@ -31261,10 +31289,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144) { - sigOutput = kind === 1 ? 172 : 171; + sigOutput = kind === 1 ? 171 : 170; } else { - sigOutput = kind === 1 ? 167 : 166; + sigOutput = kind === 1 ? 166 : 165; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -31383,23 +31411,23 @@ var ts; return ts.createKeywordTypeNode(125); } if (type.flags & 2) { - return ts.createKeywordTypeNode(149); + return ts.createKeywordTypeNode(148); } if (type.flags & 4) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144); + return ts.createKeywordTypeNode(143); } if (type.flags & 8) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141); + return ts.createKeywordTypeNode(140); } if (type.flags & 64) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152); + return ts.createKeywordTypeNode(151); } if (type.flags & 16) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129); + return ts.createKeywordTypeNode(128); } if (type.flags & 1024 && !(type.flags & 1048576)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -31440,7 +31468,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148, ts.createKeywordTypeNode(145)); + return ts.createTypeOperatorNode(147, ts.createKeywordTypeNode(144)); } if (type.flags & 16384) { context.approximateLength += 4; @@ -31448,7 +31476,7 @@ var ts; } if (type.flags & 32768) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147); + return ts.createKeywordTypeNode(146); } if (type.flags & 65536) { context.approximateLength += 4; @@ -31456,15 +31484,15 @@ var ts; } if (type.flags & 131072) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138); + return ts.createKeywordTypeNode(137); } if (type.flags & 4096) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145); + return ts.createKeywordTypeNode(144); } if (type.flags & 67108864) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142); + return ts.createKeywordTypeNode(141); } if (isThisTypeParameter(type)) { if (context.flags & 4194304) { @@ -31512,7 +31540,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 ? 179 : 180, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 ? 178 : 179, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -31538,11 +31566,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128, awaitedTypeNode); - } if (type.flags & 16777216) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -31583,7 +31606,7 @@ var ts; var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 : 111551; return symbolToTypeNode(symbol, context, isInstanceType); } - else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 && context.flags & 2048) || + else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 && context.flags & 2048) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551); @@ -31610,7 +31633,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 || declaration.parent.kind === 251; + return declaration.parent.kind === 290 || declaration.parent.kind === 250; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096) || (context.visitedTypes && context.visitedTypes.has(typeId))) && @@ -31658,12 +31681,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171, context); return signatureNode; } } @@ -31684,7 +31707,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138, arrayType); } else if (type.target.objectFlags & 8) { if (typeArguments.length > 0) { @@ -31698,12 +31721,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; @@ -31791,11 +31814,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -31872,7 +31895,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768); }), 0); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -31889,7 +31912,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -31897,8 +31920,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -31948,14 +31971,14 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 144 : 141); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 143 : 140); var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); var typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context); if (!indexInfo.type && !(context.flags & 2097152)) { context.encounteredError = true; } context.approximateLength += (name.length + 4); - return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(139)] : undefined, [indexingParameter], typeNode); + return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(138)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256; @@ -31969,7 +31992,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -32013,9 +32036,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -32027,7 +32050,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) : - parameterDeclaration.name.kind === 154 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) : + parameterDeclaration.name.kind === 153 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -32044,7 +32067,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192) { + if (clone.kind === 191) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 | 16777216); @@ -32169,7 +32192,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291); + var file = ts.getDeclarationOfKind(symbol, 290); if (file && file.moduleName !== undefined) { return file.moduleName; } @@ -32452,8 +32475,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162, true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161, false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161, true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160, false); var enclosingDeclaration = context.enclosingDeclaration; var results = []; var visitedSymbols = ts.createMap(); @@ -32736,8 +32759,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0, interfaceType, baseType, 166); - var constructSignatures = serializeSignatures(1, interfaceType, baseType, 167); + var callSignatures = serializeSignatures(0, interfaceType, baseType, 165); + var constructSignatures = serializeSignatures(1, interfaceType, baseType, 166); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration(undefined, undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, constructSignatures, callSignatures, members)), modifierFlags); @@ -32810,7 +32833,7 @@ var ts; var signatures = getSignaturesOfType(type, 0); for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; - var decl = signatureToSignatureDeclarationHelper(sig, 245, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -32879,7 +32902,7 @@ var ts; var staticMembers = symbol.flags & (16 | 512) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, true, staticBaseType); }); - var constructors = serializeSignatures(1, staticType, baseTypes[0], 163); + var constructors = serializeSignatures(1, staticType, baseTypes[0], 162); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; c.type = undefined; @@ -32903,38 +32926,38 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 254: + case 253: var isLocalImport = !(target.flags & 512); addResult(ts.createImportEqualsDeclaration(undefined, undefined, ts.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863, false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0); break; - case 253: + case 252: addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0); break; - case 256: + case 255: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(ts.createIdentifier(localName), undefined), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 257: + case 256: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 263: + case 262: addResult(ts.createExportDeclaration(undefined, undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 259: + case 258: addResult(ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 264: + case 263: var specifier = node.parent.parent.moduleSpecifier; serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260: + case 259: serializeMaybeAliasAssignment(symbol); break; - case 210: - case 195: + case 209: + case 194: if (symbol.escapedName === "default" || symbol.escapedName === "export=") { serializeMaybeAliasAssignment(symbol); } @@ -33095,17 +33118,17 @@ var ts; context.flags = oldFlags; return result; function visitExistingNodeTreeSymbols(node) { - if (ts.isJSDocAllType(node) || node.kind === 303) { + if (ts.isJSDocAllType(node) || node.kind === 302) { return ts.createKeywordTypeNode(125); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149); + return ts.createKeywordTypeNode(148); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -33353,8 +33376,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183; }); - if (node.kind === 248) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182; }); + if (node.kind === 247) { return getSymbolOfNode(node); } } @@ -33362,11 +33385,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 && + node.parent.kind === 250 && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 || ts.isAmbientModule(location); + return location.kind === 290 || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -33414,17 +33437,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 243) { + if (declaration.parent && declaration.parent.kind === 242) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215: + case 214: + case 201: case 202: - case 203: if (context && !context.encounteredError && !(context.flags & 131072)) { context.encounteredError = true; } - return declaration.kind === 215 ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -33441,67 +33464,67 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { + case 315: + case 322: case 316: - case 323: - case 317: return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192: + case 191: return isDeclarationVisible(node.parent.parent); - case 243: + case 242: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 250: + case 249: + case 245: case 246: case 247: + case 244: case 248: - case 245: - case 249: - case 254: + case 253: if (ts.isExternalModuleAugmentation(node)) { return true; } var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 254 && parent.kind !== 291 && parent.flags & 8388608)) { + !(node.kind !== 253 && parent.kind !== 290 && parent.flags & 8388608)) { return isGlobalSourceFile(parent); } return isDeclarationVisible(parent); - case 160: case 159: + case 158: + case 163: case 164: - case 165: - case 162: case 161: + case 160: if (ts.hasModifier(node, 8 | 16)) { return false; } - case 163: - case 167: + case 162: case 166: - case 168: - case 157: - case 251: - case 171: - case 172: - case 174: - case 170: - case 175: - case 176: - case 179: - case 180: - case 183: - return isDeclarationVisible(node.parent); - case 256: - case 257: - case 259: - return false; + case 165: + case 167: case 156: - case 291: - case 253: + case 250: + case 170: + case 171: + case 173: + case 169: + case 174: + case 175: + case 178: + case 179: + case 182: + return isDeclarationVisible(node.parent); + case 255: + case 256: + case 258: + return false; + case 155: + case 290: + case 252: return true; - case 260: + case 259: return false; default: return false; @@ -33510,10 +33533,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260) { + if (node.parent && node.parent.kind === 259) { exportSymbol = resolveName(node, node.escapedText, 111551 | 788968 | 1920 | 2097152, undefined, node, false); } - else if (node.parent.kind === 264) { + else if (node.parent.kind === 263) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 | 788968 | 1920 | 2097152); } var result; @@ -33599,12 +33622,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { + case 242: case 243: - case 244: - case 259: case 258: case 257: case 256: + case 255: return false; default: return true; @@ -33630,7 +33653,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 155 && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304); }); @@ -33675,7 +33698,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196, node.pos, node.end); + var result = ts.createNode(195, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10, node.pos, node.end); @@ -33690,23 +33713,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192: - case 282: + case 191: + case 281: return getSyntheticElementAccess(ancestor); - case 193: + case 192: return getSyntheticElementAccess(node.parent); - case 243: + case 242: return ancestor.initializer; - case 210: + case 209: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 && parent.kind === 190) { + if (node.kind === 191 && parent.kind === 189) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 || node.kind === 283) { + if (node.kind === 281 || node.kind === 282) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -33728,7 +33751,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288); } var type; - if (pattern.kind === 190) { + if (pattern.kind === 189) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 || !isValidSpreadType(parentType)) { @@ -33792,18 +33815,18 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 && expr.elements.length === 0; + return expr.kind === 192 && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232) { var forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement) || anyType; } @@ -33817,7 +33840,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 8388608)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -33826,10 +33849,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157) { + if (declaration.kind === 156) { var func = declaration.parent; - if (func.kind === 165 && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164); + if (func.kind === 164 && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -34030,9 +34053,9 @@ var ts; } function isDeclarationInConstructor(expression) { var thisContainer = ts.getThisContainer(expression, false); - return thisContainer.kind === 163 || - thisContainer.kind === 245 || - (thisContainer.kind === 202 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 || + thisContainer.kind === 244 || + (thisContainer.kind === 201 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -34102,7 +34125,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } @@ -34119,7 +34142,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 + return pattern.kind === 189 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -34146,7 +34169,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 ? root.parent : root; + var memberDeclaration = root.kind === 156 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -34195,7 +34218,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260) { + if (declaration.kind === 259) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -34262,7 +34285,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164) { + if (accessor.kind === 163) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -34296,15 +34319,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164); + var getter = ts.getDeclarationOfKind(symbol, 163); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164); - var setter = ts.getDeclarationOfKind(symbol, 165); + var getter = ts.getDeclarationOfKind(symbol, 163); + var setter = ts.getDeclarationOfKind(symbol, 164); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -34367,9 +34390,9 @@ var ts; if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 || + else if (declaration.kind === 209 || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210) { + declaration.parent.kind === 209) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -34429,7 +34452,7 @@ var ts; error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); return errorType; } - if (noImplicitAny && (declaration.kind !== 157 || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } return anyType; @@ -34519,43 +34542,43 @@ var ts; return undefined; } switch (node.kind) { - case 246: - case 215: - case 247: - case 166: - case 167: - case 161: - case 171: - case 172: - case 301: case 245: - case 162: + case 214: + case 246: + case 165: + case 166: + case 160: + case 170: + case 171: + case 300: + case 244: + case 161: + case 201: case 202: - case 203: - case 248: + case 247: + case 321: case 322: - case 323: - case 317: case 316: - case 187: - case 181: + case 315: + case 186: + case 180: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187) { + if (node.kind === 186) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181) { + else if (node.kind === 180) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 || node.kind === 215 || node.kind === 247 || isJSConstructor(node)) && + (node.kind === 245 || node.kind === 214 || node.kind === 246 || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -34563,9 +34586,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 || - node.kind === 246 || - node.kind === 215 || + if (node.kind === 246 || + node.kind === 245 || + node.kind === 214 || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -34754,7 +34777,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -34783,7 +34806,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247) { + if (declaration.kind === 246) { if (declaration.flags & 128) { return false; } @@ -34860,7 +34883,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210) { + else if (expr.kind === 209) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -34875,12 +34898,12 @@ var ts; case 8: case 14: return true; - case 208: + case 207: return expr.operator === 40 && expr.operand.kind === 8; case 75: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210: + case 209: return isStringConcatExpression(expr); default: return false; @@ -34894,7 +34917,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249) { + if (declaration.kind === 248) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -34921,7 +34944,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249) { + if (declaration.kind === 248) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -34989,22 +35012,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125: - case 149: + case 148: + case 143: + case 140: + case 151: + case 128: case 144: case 141: - case 152: - case 129: - case 145: - case 142: case 110: - case 147: + case 146: case 100: - case 138: - case 188: + case 137: + case 187: return true; - case 175: + case 174: return isThislessType(node.elementType); - case 170: + case 169: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -35020,7 +35043,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -35029,14 +35052,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160: case 159: + case 158: return isThislessVariableLikeDeclaration(declaration); - case 162: case 161: + case 160: + case 162: case 163: case 164: - case 165: return isThislessFunctionLikeDeclaration(declaration); } } @@ -35815,8 +35838,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 185 && - constraintDeclaration.operator === 135; + return constraintDeclaration.kind === 184 && + constraintDeclaration.operator === 134; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -36013,7 +36036,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432) { + if (t.flags & 63176704) { var constraint = getConstraintOfType(t); while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) { constraint = getConstraintOfType(constraint); @@ -36043,7 +36066,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 | 3145728)) { + if (type.flags & (58982400 | 3145728)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -36132,10 +36155,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432) { return getBaseConstraint(t.substitute); } @@ -36189,7 +36208,7 @@ var ts; return type; } function getApparentType(type) { - var t = type.flags & 197394432 ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) : t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) : t.flags & 132 ? globalStringType : @@ -36442,10 +36461,10 @@ var ts; return result; } function isJSDocOptionalParameter(node) { - return ts.isInJSFile(node) && (node.type && node.type.kind === 300 + return ts.isInJSFile(node) && (node.type && node.type.kind === 299 || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -36478,7 +36497,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -36551,7 +36570,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188) { + if (type && type.kind === 187) { flags |= 2; } var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) || @@ -36562,16 +36581,16 @@ var ts; minArgumentCount = parameters.length; } } - if ((declaration.kind === 164 || declaration.kind === 165) && + if ((declaration.kind === 163 || declaration.kind === 164) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 ? 165 : 164; + var otherKind = declaration.kind === 163 ? 164 : 163; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 ? + var classType = declaration.kind === 162 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -36627,11 +36646,11 @@ var ts; switch (node.kind) { case 75: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160: - case 162: + case 159: + case 161: + case 163: case 164: - case 165: - return node.name.kind === 155 + return node.name.kind === 154 && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -36700,7 +36719,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 ? + return parameterName.kind === 183 ? createTypePredicate(node.assertsModifier ? 2 : 0, undefined, undefined, type) : createTypePredicate(node.assertsModifier ? 3 : 1, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -36743,7 +36762,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163) { + if (declaration.kind === 162) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -36753,12 +36772,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -36837,7 +36856,7 @@ var ts; function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0; - var isConstructor = kind === 163 || kind === 167 || kind === 172; + var isConstructor = kind === 162 || kind === 166 || kind === 171; var type = createObjectType(16); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -36851,7 +36870,7 @@ var ts; return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 141 : 144; + var syntaxKind = kind === 1 ? 140 : 143; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -36885,9 +36904,9 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182) { + if (declaration.parent.kind === 181) { var grandParent = declaration.parent.parent; - if (grandParent.kind === 170) { + if (grandParent.kind === 169) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -36904,7 +36923,7 @@ var ts; } } } - else if (grandParent.kind === 157 && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -36926,7 +36945,7 @@ var ts; else { var type = getTypeFromTypeNode(constraintDeclaration); if (type.flags & 1 && type !== errorType) { - type = constraintDeclaration.parent.parent.kind === 187 ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -36935,7 +36954,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -37011,8 +37030,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -37052,7 +37071,7 @@ var ts; return errorType; } } - if (node.kind === 170 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, undefined); } var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); @@ -37089,9 +37108,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170: + case 169: return node.typeName; - case 217: + case 216: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -37147,7 +37166,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 && node.qualifier; if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } @@ -37172,7 +37191,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 && node.elementTypes.length === 1; + return node.kind === 175 && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -37181,9 +37200,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304) { + while (node && !ts.isStatement(node) && node.kind !== 303) { var parent = node.parent; - if (parent.kind === 181 && node === parent.trueType) { + if (parent.kind === 180 && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -37194,7 +37213,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304) && (node.kind === 170 || node.kind === 189); + return !!(node.flags & 4194304) && (node.kind === 169 || node.kind === 188); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -37300,9 +37319,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { + case 245: case 246: - case 247: - case 249: + case 248: return declaration; } } @@ -37419,58 +37438,58 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178) { + if (node.kind === 174 || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, undefined); } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183: - case 170: + case 182: + case 169: + case 178: case 179: - case 180: - case 186: - case 181: case 185: + case 180: + case 184: return isResolvedByTypeAlias(parent); - case 248: + case 247: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 170: + case 169: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968).flags & 524288); - case 173: + case 172: return true; - case 185: - return node.operator !== 148 && mayResolveTypeAlias(node.type); - case 183: - case 177: - case 300: - case 298: + case 184: + return node.operator !== 147 && mayResolveTypeAlias(node.type); + case 182: + case 176: case 299: - case 295: + case 297: + case 298: + case 294: return mayResolveTypeAlias(node.type); + case 177: + return node.type.kind !== 174 || mayResolveTypeAlias(node.type.elementType); case 178: - return node.type.kind !== 175 || mayResolveTypeAlias(node.type.elementType); case 179: - case 180: return ts.some(node.types, mayResolveTypeAlias); - case 186: + case 185: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181: + case 180: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -37484,18 +37503,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, undefined); } else { - var elementTypes = node.kind === 175 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139; + return ts.isTypeOperatorNode(node) && node.operator === 138; } function createTupleTypeOfArity(arity, minLength, hasRestElement, readonly, associatedNames) { var typeParameters; @@ -37591,7 +37610,7 @@ var ts; } if (!(flags & 131072)) { includes |= flags & 71041023; - if (flags & 201064448) + if (flags & 66846720) includes |= 262144; if (type === wildcardType) includes |= 8388608; @@ -37709,7 +37728,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 ? 0 : 262144) | + var objectFlags = (includes & 66994211 ? 0 : 262144) | (includes & 2097152 ? 268435456 : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -38012,7 +38031,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 | 4)); }) : type === wildcardType ? wildcardType : type.flags & 2 ? neverType : @@ -38034,24 +38053,20 @@ var ts; return indexType.flags & 131072 ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135: + case 134: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148: - links.resolvedType = node.type.kind === 145 + case 147: + links.resolvedType = node.type.kind === 144 ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139: + case 138: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -38077,13 +38092,13 @@ var ts; if (type.flags & 2097152) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432) { + if (type.flags & 63176704) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -38093,7 +38108,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -38230,9 +38245,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 ? accessNode.argumentExpression : - accessNode.kind === 186 ? accessNode.indexType : - accessNode.kind === 155 ? accessNode.expression : + return accessNode.kind === 195 ? accessNode.argumentExpression : + accessNode.kind === 185 ? accessNode.indexType : + accessNode.kind === 154 ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -38243,7 +38258,7 @@ var ts; } return !!(type.objectFlags & 8388608); } - return !!(type.flags & 193200128) || isGenericMappedType(type); + return !!(type.flags & 58982400) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728) { @@ -38253,7 +38268,7 @@ var ts; } return !!(type.objectFlags & 33554432); } - return !!(type.flags & (193200128 | 4194304)); + return !!(type.flags & (58982400 | 4194304)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 && type.isThisType); @@ -38293,7 +38308,7 @@ var ts; if (distributedOverIndex) { return type[cache] = distributedOverIndex; } - if (!(indexType.flags & 197394432)) { + if (!(indexType.flags & 63176704)) { var distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); if (distributedOverObject) { return type[cache] = distributedOverObject; @@ -38346,7 +38361,7 @@ var ts; if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 4 | 8)) { indexType = stringType; } - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185) && isGenericObjectType(objectType)) { if (objectType.flags & 3) { return objectType; } @@ -38624,7 +38639,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -38855,7 +38870,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246)) { if (!ts.hasModifier(container, 32) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -38887,86 +38902,86 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125: + case 295: case 296: - case 297: return anyType; - case 149: + case 148: return unknownType; - case 144: + case 143: return stringType; - case 141: + case 140: return numberType; - case 152: + case 151: return bigintType; - case 129: + case 128: return booleanType; - case 145: + case 144: return esSymbolType; case 110: return voidType; - case 147: + case 146: return undefinedType; case 100: return nullType; - case 138: + case 137: return neverType; - case 142: + case 141: return node.flags & 131072 && !noImplicitAny ? anyType : nonPrimitiveType; - case 184: + case 183: case 104: return getTypeFromThisTypeNode(node); - case 188: - return getTypeFromLiteralTypeNode(node); - case 170: - return getTypeFromTypeReference(node); - case 169: - return node.assertsModifier ? voidType : booleanType; - case 217: - return getTypeFromTypeReference(node); - case 173: - return getTypeFromTypeQueryNode(node); - case 175: - case 176: - return getTypeFromArrayOrTupleTypeNode(node); - case 177: - return getTypeFromOptionalTypeNode(node); - case 179: - return getTypeFromUnionTypeNode(node); - case 180: - return getTypeFromIntersectionTypeNode(node); - case 298: - return getTypeFromJSDocNullableTypeNode(node); - case 300: - return addOptionality(getTypeFromTypeNode(node.type)); - case 183: - case 299: - case 295: - return getTypeFromTypeNode(node.type); - case 178: - return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302: - return getTypeFromJSDocVariadicType(node); - case 171: - case 172: - case 174: - case 305: - case 301: - case 306: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185: - return getTypeFromTypeOperatorNode(node); - case 186: - return getTypeFromIndexedAccessTypeNode(node); case 187: - return getTypeFromMappedTypeNode(node); - case 181: - return getTypeFromConditionalTypeNode(node); + return getTypeFromLiteralTypeNode(node); + case 169: + return getTypeFromTypeReference(node); + case 168: + return node.assertsModifier ? voidType : booleanType; + case 216: + return getTypeFromTypeReference(node); + case 172: + return getTypeFromTypeQueryNode(node); + case 174: + case 175: + return getTypeFromArrayOrTupleTypeNode(node); + case 176: + return getTypeFromOptionalTypeNode(node); + case 178: + return getTypeFromUnionTypeNode(node); + case 179: + return getTypeFromIntersectionTypeNode(node); + case 297: + return getTypeFromJSDocNullableTypeNode(node); + case 299: + return addOptionality(getTypeFromTypeNode(node.type)); case 182: + case 298: + case 294: + return getTypeFromTypeNode(node.type); + case 177: + return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; + case 301: + return getTypeFromJSDocVariadicType(node); + case 170: + case 171: + case 173: + case 304: + case 300: + case 305: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 184: + return getTypeFromTypeOperatorNode(node); + case 185: + return getTypeFromIndexedAccessTypeNode(node); + case 186: + return getTypeFromMappedTypeNode(node); + case 180: + return getTypeFromConditionalTypeNode(node); + case 181: return getTypeFromInferTypeNode(node); - case 189: + case 188: return getTypeFromImportTypeNode(node); case 75: - case 154: + case 153: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -39148,15 +39163,15 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 || - node.parent.kind === 170 && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 || + node.parent.kind === 169 && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 || n.kind === 181 && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 || n.kind === 180 && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -39165,12 +39180,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184: + case 183: return !!tp.isThisType; case 75: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; - case 173: + case 172: return true; } return !!ts.forEachChild(node, containsReference); @@ -39192,7 +39207,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 | 193200128 | 524288 | 2097152) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -39296,7 +39311,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144) { return getMappedType(type, mapper); @@ -39341,9 +39355,6 @@ var ts; if (flags & 16777216) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752) { @@ -39378,34 +39389,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); switch (node.kind) { + case 201: case 202: - case 203: - case 162: - case 245: + case 161: + case 244: return isContextSensitiveFunctionLikeDeclaration(node); - case 194: - return ts.some(node.properties, isContextSensitive); case 193: + return ts.some(node.properties, isContextSensitive); + case 192: return ts.some(node.elements, isContextSensitive); - case 211: + case 210: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210: + case 209: return (node.operatorToken.kind === 56 || node.operatorToken.kind === 60) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282: + case 281: return isContextSensitive(node.initializer); - case 201: + case 200: return isContextSensitive(node.expression); - case 275: + case 274: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274: { + case 273: { var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277: { + case 276: { var expression = node.expression; return !!expression && isContextSensitive(expression); } @@ -39421,7 +39432,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203) { + if (node.kind !== 202) { var parameter = ts.firstOrUndefined(node.parameters); if (!(parameter && ts.parameterIsThisKeyword(parameter))) { return true; @@ -39431,7 +39442,7 @@ var ts; return false; } function hasContextSensitiveReturnExpression(node) { - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -39475,7 +39486,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 | 67108864)) : target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -39511,23 +39522,23 @@ var ts; return true; } switch (node.kind) { - case 277: - case 201: + case 276: + case 200: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210: + case 209: switch (node.operatorToken.kind) { case 62: case 27: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194: - return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); case 193: + return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 192: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275: + case 274: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203: + case 202: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -39705,16 +39716,16 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277: + case 276: return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; + case 266: case 267: - case 268: - case 271: + case 270: return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); @@ -39859,11 +39870,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165: return [3, 2]; case 164: return [3, 2]; - case 162: return [3, 2]; - case 283: return [3, 2]; - case 282: return [3, 4]; + case 163: return [3, 2]; + case 161: return [3, 2]; + case 282: return [3, 2]; + case 281: return [3, 4]; } return [3, 6]; case 2: return [4, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -39927,8 +39938,8 @@ var ts; return 0; } var kind = target.declaration ? target.declaration.kind : 0; - var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 162 && - kind !== 161 && kind !== 163; + var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 161 && + kind !== 160 && kind !== 162; var result = -1; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -40169,7 +40180,7 @@ var ts; return !!(related & 1); } } - if (source.flags & 201064448 || target.flags & 201064448) { + if (source.flags & 66846720 || target.flags & 66846720) { return checkTypeRelatedTo(source, target, relation, undefined); } return false; @@ -40505,7 +40516,7 @@ var ts; result = someTypeRelatedToType(source, target, false, 1); } } - if (!result && (source.flags & 201064448 || target.flags & 201064448)) { + if (!result && (source.flags & 66846720 || target.flags & 66846720)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -40820,8 +40831,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 : 8; + propagatingVarianceFlags |= onlyUnreliable ? 16 : 8; return originalHandler(onlyUnreliable); }; } @@ -40932,13 +40942,6 @@ var ts; } } } - else if (target.flags & 134217728 && source.flags & 134217728) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -41041,15 +41044,6 @@ var ts; } } } - else if (source.flags & 134217728) { - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { return -1; @@ -41767,11 +41761,13 @@ var ts; variance = 4; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8; - } - if (unreliable) { - variance |= 16; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8; + } + if (unreliable) { + variance |= 16; + } } variances.push(variance); }; @@ -42434,12 +42430,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210: - case 160: + case 209: case 159: + case 158: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157: + case 156: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -42454,22 +42450,22 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192: + case 191: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 301: + case 300: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245: - case 162: + case 244: case 161: + case 160: + case 163: case 164: - case 165: + case 201: case 202: - case 203: if (noImplicitAny && !declaration.name) { if (wideningKind === 1) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -42483,7 +42479,7 @@ var ts; wideningKind === 1 ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187: + case 186: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -42607,7 +42603,7 @@ var ts; if (objectFlags & 67108864) { return !!(objectFlags & 134217728); } - var result = !!(type.flags & 197394432 || + var result = !!(type.flags & 63176704 || objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations || objectFlags & (32 | 131072) || @@ -42847,7 +42843,7 @@ var ts; } else if (target.flags & 8388608) { var indexType = getSimplifiedType(target.indexType, false); - if (indexType.flags & 197394432) { + if (indexType.flags & 63176704) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -42881,9 +42877,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 && target.flags & 134217728) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216) { var savePriority = priority; priority |= contravariant ? 16 : 0; @@ -42891,10 +42884,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728) { inferToMultipleTypes(source, target.types, target.flags); } @@ -42907,7 +42896,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 && source.flags & (2097152 | 197394432))) { + if (!(priority & 128 && source.flags & (2097152 | 63176704))) { var apparentSource = getApparentType(source); if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) { allowComplexConstraintInference = false; @@ -43009,36 +42998,20 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576) { var nakedTypeVariable = void 0; + var sources = source.flags & 1048576 ? source.types : [source]; + var matched_1 = new Array(sources.length); + var inferenceCircularity = false; for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { var t = targets_2[_i]; if (getInferenceInfoForType(t)) { nakedTypeVariable = t; typeVariableCount++; } - } - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } - var sources = source.flags & 1048576 ? source.types : [source]; - var matched_1 = new Array(sources.length); - var inferenceCircularity = false; - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512; @@ -43066,8 +43039,8 @@ var ts; } } else { - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -43077,8 +43050,8 @@ var ts; } } if (targetFlags & 2097152 ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1); } @@ -43211,7 +43184,7 @@ var ts; if (!skipParameters) { var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0; - bivariant = bivariant || kind === 162 || kind === 161 || kind === 163; + bivariant = bivariant || kind === 161 || kind === 160 || kind === 162; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -43363,7 +43336,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283) { + if (node.parent.kind === 282) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -43380,7 +43353,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - return !!ts.findAncestor(node, function (n) { return n.kind === 173 ? true : n.kind === 75 || n.kind === 154 ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 ? true : n.kind === 75 || n.kind === 153 ? false : "quit"; }); } function getFlowCacheKey(node, declaredType, initialType, flowContainer) { switch (node.kind) { @@ -43389,11 +43362,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104: return "0"; - case 219: - case 201: + case 218: + case 200: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + case 194: case 195: - case 196: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -43404,24 +43377,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201: - case 219: + case 200: + case 218: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75: return target.kind === 75 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 || target.kind === 192) && + (target.kind === 242 || target.kind === 191) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104: return target.kind === 104; case 102: return target.kind === 102; - case 219: - case 201: + case 218: + case 200: return isMatchingReference(source.expression, target); + case 194: case 195: - case 196: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -43430,11 +43403,11 @@ var ts; } function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 && target.operatorToken.kind === 55 && + (target.kind === 209 && target.operatorToken.kind === 55 && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 ? access.name.escapedText : + return access.kind === 194 ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -43463,7 +43436,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192) === 192 && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704); } return !!prop.isDiscriminantProperty; } @@ -43496,7 +43469,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 && + if (callExpression.expression.kind === 194 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -43605,7 +43578,7 @@ var ts; if (flags & 67108864) { return strictNullChecks ? 7888800 : 16736160; } - if (flags & 197394432) { + if (flags & 63176704) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728) { @@ -43642,15 +43615,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65, type, undefinedType, undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 && parent.parent.left === parent || - parent.parent.kind === 233 && parent.parent.initializer === parent; + return parent.parent.kind === 209 && parent.parent.left === parent || + parent.parent.kind === 232 && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -43667,21 +43640,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232: + case 231: return stringType; - case 233: + case 232: return checkRightHandSideOfForOf(parent) || errorType; - case 210: + case 209: return getAssignedTypeOfBinaryExpression(parent); - case 204: + case 203: return undefinedType; - case 193: + case 192: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214: + case 213: return getAssignedTypeOfSpreadExpression(parent); - case 282: + case 281: return getAssignedTypeOfPropertyAssignment(parent); - case 283: + case 282: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -43689,7 +43662,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 ? + var type = pattern.kind === 189 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -43704,30 +43677,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232) { + if (node.parent.parent.kind === 231) { return stringType; } - if (node.parent.parent.kind === 233) { + if (node.parent.parent.kind === 232) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 ? + return node.kind === 242 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 && node.initializer && + return node.kind === 242 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 && node.parent.kind === 210 && + node.kind !== 191 && node.parent.kind === 209 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201: + case 200: return getReferenceCandidate(node.expression); - case 210: + case 209: switch (node.operatorToken.kind) { case 62: return getReferenceCandidate(node.left); @@ -43739,13 +43712,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 || - parent.kind === 210 && parent.operatorToken.kind === 62 && parent.left === node || - parent.kind === 210 && parent.operatorToken.kind === 27 && parent.right === node ? + return parent.kind === 200 || + parent.kind === 209 && parent.operatorToken.kind === 62 && parent.left === node || + parent.kind === 209 && parent.operatorToken.kind === 27 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278) { + if (clause.kind === 277) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -43765,7 +43738,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278) { + if (clause.kind === 277) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -43911,12 +43884,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 + parent.parent.kind === 196 && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 && + var isElementAssignment = parent.kind === 195 && parent.expression === root && - parent.parent.kind === 210 && + parent.parent.kind === 209 && parent.parent.operatorToken.kind === 62 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -43924,8 +43897,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 || declaration.kind === 157 || - declaration.kind === 160 || declaration.kind === 159) && + return (declaration.kind === 242 || declaration.kind === 156 || + declaration.kind === 159 || declaration.kind === 158) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -43938,7 +43911,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -43960,11 +43933,11 @@ var ts; return getExplicitThisType(node); case 102: return checkSuperExpression(node); - case 195: + case 194: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201: + case 200: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -43974,7 +43947,7 @@ var ts; var signature = links.effectsSignature; if (signature === undefined) { var funcType = void 0; - if (node.parent.kind === 227) { + if (node.parent.kind === 226) { funcType = getTypeOfDottedName(node.expression, undefined); } else if (node.expression.kind !== 102) { @@ -44018,7 +43991,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 || node.kind === 210 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 || node.kind === 209 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -44088,7 +44061,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943)) { return declaredType; } flowInvocationCount++; @@ -44096,7 +44069,7 @@ var ts; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); sharedFlowCount = sharedFlowStart; var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 && getTypeWithFacts(resultType, 2097152).flags & 131072) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 && getTypeWithFacts(resultType, 2097152).flags & 131072) { return declaredType; } return resultType; @@ -44171,8 +44144,8 @@ var ts; else if (flags & 2) { var container = flow.node; if (container && container !== flowContainer && + reference.kind !== 194 && reference.kind !== 195 && - reference.kind !== 196 && reference.kind !== 104) { flow = container.flowNode; continue; @@ -44193,7 +44166,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 || node.kind === 192 ? + return getConstraintForLocation(node.kind === 242 || node.kind === 191 ? getInitialType(node) : getAssignedType(node), reference); } @@ -44225,13 +44198,13 @@ var ts; } if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 || init.kind === 203)) { + if (init && (init.kind === 201 || init.kind === 202)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } return undefined; @@ -44241,7 +44214,7 @@ var ts; if (node.kind === 91) { return unreachableNeverType; } - if (node.kind === 210) { + if (node.kind === 209) { if (node.operatorToken.kind === 55) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -44272,7 +44245,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 ? + var expr = node.kind === 196 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -44280,7 +44253,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 197) { + if (node.kind === 196) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -44322,7 +44295,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -44330,7 +44303,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 | 131072)); }); } - else if (expr.kind === 205 && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 || t.flags & 128 && t.value === "undefined"); }); } } @@ -44503,10 +44476,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -44617,7 +44590,7 @@ var ts; return type; } if (assumeTrue && type.flags & 2 && literal.text === "object") { - if (typeOfExpr.parent.parent.kind === 210) { + if (typeOfExpr.parent.parent.kind === 209) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -44638,7 +44611,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432) { + if (type.flags & 63176704) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -44704,7 +44677,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432) { + if (type.flags & 63176704) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -44857,16 +44830,16 @@ var ts; case 75: case 104: case 102: + case 194: case 195: - case 196: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197: + case 196: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201: + case 200: return narrowType(type, expr.expression, assumeTrue); - case 210: + case 209: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208: + case 207: if (expr.operator === 53) { return narrowType(type, expr.operand, !assumeTrue); } @@ -44902,9 +44875,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 || - node.kind === 291 || - node.kind === 160; + node.kind === 250 || + node.kind === 290 || + node.kind === 159; }); } function isParameterAssigned(symbol) { @@ -44925,7 +44898,7 @@ var ts; if (node.kind === 75) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156) { symbol.isAssigned = true; } } @@ -44940,7 +44913,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 && + declaration.kind === 156 && declaration.initializer && getFalsyFlags(declaredType) & 32768 && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768); @@ -44954,13 +44927,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 || - parent.kind === 197 && parent.expression === node || + return parent.kind === 194 || parent.kind === 196 && parent.expression === node || - parent.kind === 192 && parent.name === node && !!parent.initializer; + parent.kind === 195 && parent.expression === node || + parent.kind === 191 && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304); + return type.flags & 58982400 && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304); } function getConstraintForLocation(type, node) { if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) { @@ -44989,7 +44962,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 203) { + if (container.kind === 202) { 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)) { @@ -45005,7 +44978,7 @@ var ts; var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; if (localOrExportSymbol.flags & 32) { - if (declaration.kind === 246 + if (declaration.kind === 245 && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -45017,11 +44990,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215) { + else if (declaration.kind === 214) { var container = ts.getThisContainer(node, false); - while (container.kind !== 291) { + while (container.kind !== 290) { if (container.parent === declaration) { - if (container.kind === 160 && ts.hasModifier(container, 32)) { + if (container.kind === 159 && ts.hasModifier(container, 32)) { getNodeLinks(declaration).flags |= 16777216; getNodeLinks(node).flags |= 33554432; } @@ -45065,22 +45038,22 @@ var ts; if (!declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 157; + var isParameter = ts.getRootDeclaration(declaration).kind === 156; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); var isModuleExports = symbol.flags & 134217728; - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 || - flowContainer.kind === 203 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 || + flowContainer.kind === 202 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264) || - node.parent.kind === 219 || - declaration.kind === 243 && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263) || + node.parent.kind === 218 || + declaration.kind === 242 && declaration.exclamationToken || declaration.flags & 8388608; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -45111,7 +45084,7 @@ var ts; if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281) { + symbol.valueDeclaration.parent.kind === 280) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -45129,7 +45102,7 @@ var ts; if (usedInFunction) { var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -45148,7 +45121,7 @@ var ts; } } if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304; } @@ -45165,14 +45138,14 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 201) { + while (current.parent.kind === 200) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 || current.parent.kind === 209)) { + else if ((current.parent.kind === 207 || current.parent.kind === 208)) { var expr = current.parent; isAssigned = expr.operator === 45 || expr.operator === 46; } @@ -45183,7 +45156,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 160 || container.kind === 163) { + if (container.kind === 159 || container.kind === 162) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -45227,32 +45200,32 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var capturedByArrowFunction = false; - if (container.kind === 163) { + if (container.kind === 162) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 203) { + if (container.kind === 202) { container = ts.getThisContainer(container, false); capturedByArrowFunction = true; } switch (container.kind) { - case 250: + case 249: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 249: + case 248: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 163: + case 162: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 160: case 159: + case 158: if (ts.hasModifier(container, 32) && !(compilerOptions.target === 99 && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 155: + case 154: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -45294,7 +45267,7 @@ var ts; } } else if (isInJS && - (container.kind === 202 || container.kind === 245) && + (container.kind === 201 || container.kind === 244) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -45339,7 +45312,7 @@ var ts; } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 202 && + if (container.kind === 201 && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3) { return container.parent @@ -45347,20 +45320,20 @@ var ts; .expression .expression; } - else if (container.kind === 162 && - container.parent.kind === 194 && + else if (container.kind === 161 && + container.parent.kind === 193 && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6) { return container.parent.parent.left.expression; } - else if (container.kind === 202 && - container.parent.kind === 282 && - container.parent.parent.kind === 194 && + else if (container.kind === 201 && + container.parent.kind === 281 && + container.parent.parent.kind === 193 && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6) { return container.parent.parent.parent.left.expression; } - else if (container.kind === 202 && + else if (container.kind === 201 && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -45382,7 +45355,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301) { + if (jsdocType && jsdocType.kind === 300) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -45396,14 +45369,14 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 203) { + while (container && container.kind === 202) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -45411,14 +45384,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155; }); - if (current && current.kind === 155) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154; }); + if (current && current.kind === 154) { 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 === 194)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -45426,7 +45399,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163) { + if (!isCallExpression && container.kind === 162) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32) || isCallExpression) { @@ -45436,7 +45409,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 162 && ts.hasModifier(container, 256)) { + if (container.kind === 161 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -45447,7 +45420,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194) { + if (container.parent.kind === 193) { 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 errorType; @@ -45466,7 +45439,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } @@ -45478,24 +45451,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 163; + return container.kind === 162; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 194) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193) { if (ts.hasModifier(container, 32)) { - return container.kind === 162 || - container.kind === 161 || - container.kind === 164 || - container.kind === 165; + return container.kind === 161 || + container.kind === 160 || + container.kind === 163 || + container.kind === 164; } else { - return container.kind === 162 || - container.kind === 161 || - container.kind === 164 || - container.kind === 165 || + return container.kind === 161 || container.kind === 160 || + container.kind === 163 || + container.kind === 164 || container.kind === 159 || - container.kind === 163; + container.kind === 158 || + container.kind === 162; } } } @@ -45503,10 +45476,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 || - func.kind === 164 || - func.kind === 165) && func.parent.kind === 194 ? func.parent : - func.kind === 202 && func.parent.kind === 282 ? func.parent.parent : + return (func.kind === 161 || + func.kind === 163 || + func.kind === 164) && func.parent.kind === 193 ? func.parent : + func.kind === 201 && func.parent.kind === 281 ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -45518,7 +45491,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203) { + if (func.kind === 202) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -45542,7 +45515,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282) { + if (literal.parent.kind !== 281) { break; } literal = literal.parent.parent; @@ -45551,7 +45524,7 @@ var ts; return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); } var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 && parent.operatorToken.kind === 62) { + if (parent.kind === 209 && parent.operatorToken.kind === 62) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -45602,9 +45575,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157: + case 156: return getContextuallyTypedParameterType(declaration); - case 192: + case 191: return getContextualTypeForBindingElement(declaration); } } @@ -45612,7 +45585,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -45645,9 +45618,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2) { var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; @@ -45659,9 +45629,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -45725,7 +45692,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199) { + if (template.parent.kind === 198) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -45933,21 +45900,21 @@ var ts; case 91: case 100: case 75: - case 147: + case 146: return true; - case 195: - case 201: + case 194: + case 200: return isPossiblyDiscriminantValue(node.expression); - case 277: + case 276: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function getApparentTypeOfContextualType(node, contextFlags) { var contextualType = ts.isObjectLiteralMethod(node) ? @@ -45968,7 +45935,7 @@ var ts; } } function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704)) { var inferenceContext = getInferenceContext(node); if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) { if (contextFlags && contextFlags & 1) { @@ -45982,7 +45949,7 @@ var ts; return contextualType; } function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432) { + if (type.flags & 63176704) { return instantiateType(type, mapper); } if (type.flags & 1048576) { @@ -46002,56 +45969,56 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243: - case 157: - case 160: + case 242: + case 156: case 159: - case 192: + case 158: + case 191: return getContextualTypeForInitializerExpression(node); - case 203: - case 236: + case 202: + case 235: return getContextualTypeForReturnExpression(node); - case 213: + case 212: return getContextualTypeForYieldOperand(parent); - case 207: + case 206: return getContextualTypeForAwaitOperand(parent); - case 197: + case 196: if (parent.expression.kind === 96) { return stringType; } - case 198: + case 197: return getContextualTypeForArgument(parent, node); - case 200: - case 218: + case 199: + case 217: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210: + case 209: return getContextualTypeForBinaryOperand(node, contextFlags); + case 281: case 282: - case 283: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284: + case 283: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193: { + case 192: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211: + case 210: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222: - ts.Debug.assert(parent.parent.kind === 212); + case 221: + ts.Debug.assert(parent.parent.kind === 211); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201: { + case 200: { var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277: - return getContextualTypeForJsxExpression(parent); - case 274: case 276: + return getContextualTypeForJsxExpression(parent); + case 273: + case 275: return getContextualTypeForJsxAttribute(parent); - case 269: case 268: + case 267: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -46191,7 +46158,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 || node.kind === 203; + return node.kind === 201 || node.kind === 202; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -46199,7 +46166,7 @@ var ts; : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -46240,8 +46207,8 @@ var ts; return checkIteratedTypeOrElementType(33, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 && !!node.initializer) || - (node.kind === 210 && node.operatorToken.kind === 62); + return (node.kind === 191 && !!node.initializer) || + (node.kind === 209 && node.operatorToken.kind === 62); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -46254,7 +46221,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 && e.expression; + var spread = e.kind === 213 && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -46325,7 +46292,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155: + case 154: return isNumericComputedName(name); case 75: return isNumericLiteralName(name.escapedText); @@ -46390,7 +46357,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 || contextualType.pattern.kind === 194); + (contextualType.pattern.kind === 189 || contextualType.pattern.kind === 193); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -46404,13 +46371,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 || - memberDecl.kind === 283 || + if (memberDecl.kind === 281 || + memberDecl.kind === 282 || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -46431,8 +46398,8 @@ var ts; prop.nameType = nameType; } if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 282 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216; } @@ -46456,7 +46423,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284) { + else if (memberDecl.kind === 283) { if (languageVersion < 2) { checkExternalEmitHelpers(memberDecl, 2); } @@ -46480,7 +46447,7 @@ var ts; continue; } else { - ts.Debug.assert(memberDecl.kind === 164 || memberDecl.kind === 165); + ts.Debug.assert(memberDecl.kind === 163 || memberDecl.kind === 164); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576)) { @@ -46501,7 +46468,7 @@ var ts; } propertiesArray.push(member); } - if (contextualTypeHasPattern && node.parent.kind !== 284) { + if (contextualTypeHasPattern && node.parent.kind !== 283) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -46542,13 +46509,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432) { + if (type.flags & 63176704) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 | 67108864 | 524288 | 193200128) || + return !!(type.flags & (1 | 67108864 | 524288 | 58982400) || getFalsyFlags(type) & 117632 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 && ts.every(type.types, isValidSpreadType)); } @@ -46626,7 +46593,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276); + ts.Debug.assert(attributeDecl.kind === 275); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); attributesTable = ts.createSymbolTable(); @@ -46651,7 +46618,7 @@ var ts; spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); } } - var parent = openingLikeElement.parent.kind === 267 ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 ? openingLikeElement.parent : undefined; if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { @@ -46984,7 +46951,7 @@ var ts; } function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 ? node.right : node.kind === 189 ? node : node.name; + var errorNode = node.kind === 153 ? node.right : node.kind === 188 ? node : node.name; if (ts.getCheckFlags(prop) & 1024) { error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); return false; @@ -47118,7 +47085,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201) { + while (node.parent.kind === 200) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -47256,7 +47223,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { + if (flowContainer.kind === 162 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { assumeUninitialized = true; } } @@ -47287,8 +47254,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 && - node.parent.kind !== 170 && + else if (valueDeclaration.kind === 245 && + node.parent.kind !== 169 && !(valueDeclaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -47300,22 +47267,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160: + case 159: return true; - case 282: - case 162: + case 281: + case 161: + case 163: case 164: - case 165: - case 284: - case 155: - case 222: - case 277: + case 283: + case 154: + case 221: + case 276: + case 273: case 274: case 275: - case 276: - case 269: - case 217: - case 280: + case 268: + case 216: + case 279: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -47480,16 +47447,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195: + case 194: return isValidPropertyAccessWithType(node, node.expression.kind === 102, propertyName, getWidenedType(checkExpression(node.expression))); - case 154: + case 153: return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left))); - case 189: + case 188: return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 && node.expression.kind === 102, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 && node.expression.kind === 102, property.escapedName, type); } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { if (type === errorType || isTypeAny(type)) { @@ -47507,7 +47474,7 @@ var ts; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244) { + if (initializer.kind === 243) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -47529,7 +47496,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 && + if (node.kind === 231 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -47606,13 +47573,13 @@ var ts; if (callLikeExpressionMayHaveTypeArguments(node)) { ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199) { + if (node.kind === 198) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158) { + else if (node.kind !== 157) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -47661,7 +47628,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 || arg.kind === 221 && arg.isSpread); + return !!arg && (arg.kind === 213 || arg.kind === 220 && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -47675,9 +47642,9 @@ var ts; var callIsIncomplete = false; var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199) { + if (node.kind === 198) { argCount = args.length; - if (node.template.kind === 212) { + if (node.template.kind === 211) { var lastSpan = ts.last(node.template.templateSpans); callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -47687,7 +47654,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158) { + else if (node.kind === 157) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -47701,7 +47668,7 @@ var ts; } else { if (!node.arguments) { - ts.Debug.assert(node.kind === 198); + ts.Debug.assert(node.kind === 197); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -47777,7 +47744,7 @@ var ts; if (ts.isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 158) { + if (node.kind !== 157) { var contextualType = getContextualType(node); if (contextualType) { var outerContext = getInferenceContext(node); @@ -47805,7 +47772,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216) { + if (arg.kind !== 215) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -47819,7 +47786,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 ? mapType(type, getArrayifiedType) : - type.flags & (1 | 197394432) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 | 63176704) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -47827,7 +47794,7 @@ var ts; if (index >= argCount - 1) { var arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - return arg.kind === 221 ? + return arg.kind === 220 ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0)); } @@ -47969,7 +47936,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198) { + if (thisType && thisType !== voidType && node.kind !== 197) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = void 0; if (thisArgumentNode) { @@ -47996,7 +47963,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216) { + if (arg.kind !== 215) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, undefined, checkMode); var checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType; @@ -48030,7 +47997,7 @@ var ts; } } function getThisArgumentOfCall(node) { - if (node.kind === 197) { + if (node.kind === 196) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -48038,24 +48005,24 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221, parent.pos, parent.end); + var result = ts.createNode(220, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; return result; } function getEffectiveCallArguments(node) { - if (node.kind === 199) { + if (node.kind === 198) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212) { + if (template.kind === 211) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158) { + if (node.kind === 157) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -48079,23 +48046,23 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246: - case 215: + case 245: + case 214: return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157: + case 156: var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160: - case 162: + case 159: + case 161: + case 163: case 164: - case 165: - var hasPropDesc = parent.kind !== 160 && languageVersion !== 0; + var hasPropDesc = parent.kind !== 159 && languageVersion !== 0; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -48106,16 +48073,16 @@ var ts; } function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246: - case 215: + case 245: + case 214: return 1; - case 160: + case 159: return 2; - case 162: + case 161: + case 163: case 164: - case 165: return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3; - case 157: + case 156: return 3; default: return ts.Debug.fail(); @@ -48238,8 +48205,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199; - var isDecorator = node.kind === 158; + var isTaggedTemplate = node.kind === 198; + var isDecorator = node.kind === 157; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -48264,7 +48231,7 @@ var ts; var candidateForArgumentArityError; var candidateForTypeArgumentError; var result; - var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 197 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 196 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -48685,7 +48652,7 @@ var ts; } var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24); - if (!modifiers || declaration.kind !== 163) { + if (!modifiers || declaration.kind !== 162) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -48805,16 +48772,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246: - case 215: + case 245: + case 214: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157: + case 156: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160: + case 159: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162: + case 161: + case 163: case 164: - case 165: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -48891,16 +48858,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197: + case 196: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198: + case 197: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199: + case 198: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158: + case 157: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269: case 268: + case 267: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -48967,7 +48934,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195) { + while (parent && parent.kind === 194) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62) { @@ -48985,12 +48952,12 @@ var ts; if (node.expression.kind === 102) { return voidType; } - if (node.kind === 198) { + if (node.kind === 197) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 && - declaration.kind !== 167 && - declaration.kind !== 172 && + declaration.kind !== 162 && + declaration.kind !== 166 && + declaration.kind !== 171 && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { @@ -49006,7 +48973,7 @@ var ts; if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 && node.parent.kind === 227 && + if (node.kind === 196 && node.parent.kind === 226 && returnType.flags & 16384 && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -49107,9 +49074,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 245 + ? 244 : resolvedRequire.flags & 3 - ? 243 + ? 242 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -49136,18 +49103,18 @@ var ts; case 9: case 106: case 91: + case 192: case 193: - case 194: return true; - case 201: + case 200: return isValidConstAssertionArgument(node.expression); - case 208: + case 207: var op = node.operator; var arg = node.operand; return op === 40 && (arg.kind === 8 || arg.kind === 9) || op === 39 && arg.kind === 8; + case 194: case 195: - case 196: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -49178,8 +49145,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -49197,7 +49170,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163) { + else if (container.kind === 162) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -49410,7 +49383,7 @@ var ts; function createPromiseType(promisedType) { var globalPromiseType = getGlobalPromiseType(true); if (globalPromiseType !== emptyGenericType) { - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -49418,7 +49391,7 @@ var ts; function createPromiseLikeType(promisedType) { var globalPromiseLikeType = getGlobalPromiseLikeType(true); if (globalPromiseLikeType !== emptyGenericType) { - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -49449,7 +49422,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224) { + if (func.body.kind !== 223) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8); if (isAsync) { returnType = checkAwaitedType(returnType, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -49601,7 +49574,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205) { + if (node.expression.kind === 204) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, false); var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true); @@ -49653,11 +49626,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { + case 201: case 202: - case 203: return true; - case 162: - return func.parent.kind === 194; + case 161: + return func.parent.kind === 193; default: return false; } @@ -49671,7 +49644,7 @@ var ts; if (type && maybeTypeOfKind(type, 1 | 16384)) { return; } - if (func.kind === 161 || ts.nodeIsMissing(func.body) || func.body.kind !== 224 || !functionHasImplicitReturn(func)) { + if (func.kind === 160 || ts.nodeIsMissing(func.body) || func.body.kind !== 223 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512; @@ -49698,7 +49671,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); if (checkMode && checkMode & 4 && isContextSensitive(node)) { if (!ts.getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) { @@ -49718,7 +49691,7 @@ var ts; return anyFunctionType; } var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202) { + if (!hasGrammarError && node.kind === 201) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -49766,7 +49739,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -49774,7 +49747,7 @@ var ts; if (!ts.getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224) { + if (node.body.kind === 223) { checkSourceElement(node.body); } else { @@ -49846,7 +49819,7 @@ var ts; ts.isAccessExpression(expr) && expr.expression.kind === 104) { var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163)) { + if (!(ctor && ctor.kind === 162)) { return true; } if (symbol.valueDeclaration) { @@ -49870,14 +49843,14 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257; + return !!declaration && declaration.kind === 256; } } } return false; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { - var node = ts.skipOuterExpressions(expr, 2 | 1); + var node = ts.skipOuterExpressions(expr, 6 | 1); if (node.kind !== 75 && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -49895,7 +49868,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -49943,7 +49916,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 && (ts.getFunctionFlags(func) & 2) === 0) { + if (func && func.kind !== 162 && (ts.getFunctionFlags(func) & 2) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -50100,7 +50073,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 | 12288))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 | 193200128)) { + if (!allTypesAssignableToKind(rightType, 67108864 | 58982400)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -50119,7 +50092,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 || property.kind === 283) { + if (property.kind === 281 || property.kind === 282) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -50132,9 +50105,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 ? property : property.initializer, type); } - else if (property.kind === 284) { + else if (property.kind === 283) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -50174,8 +50147,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216) { - if (element.kind !== 214) { + if (element.kind !== 215) { + if (element.kind !== 213) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { var accessFlags = hasDefaultValue(element) ? 8 : 0; @@ -50191,7 +50164,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 && restExpression.operatorToken.kind === 62) { + if (restExpression.kind === 209 && restExpression.operatorToken.kind === 62) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -50207,7 +50180,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283) { + if (exprOrAssignment.kind === 282) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && @@ -50221,24 +50194,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 && target.operatorToken.kind === 62) { + if (target.kind === 209 && target.operatorToken.kind === 62) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194) { + if (target.kind === 193) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193) { + if (target.kind === 192) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 ? + var error = target.parent.kind === 283 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 ? + var optionalError = target.parent.kind === 283 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -50255,36 +50228,36 @@ var ts; case 75: case 10: case 13: - case 199: - case 212: + case 198: + case 211: case 14: case 8: case 9: case 106: case 91: case 100: - case 147: + case 146: + case 201: + case 214: case 202: - case 215: - case 203: + case 192: case 193: - case 194: - case 205: - case 219: - case 268: + case 204: + case 218: case 267: + case 266: return true; - case 211: + case 210: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210: + case 209: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); + case 207: case 208: - case 209: switch (node.operator) { case 53: case 39: @@ -50293,9 +50266,9 @@ var ts; return true; } return false; - case 206: - case 200: - case 218: + case 205: + case 199: + case 217: default: return false; } @@ -50321,7 +50294,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 && (node.left.kind === 194 || node.left.kind === 193)) { + if (operator === 62 && (node.left.kind === 193 || node.left.kind === 192)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104)); break; } @@ -50382,7 +50355,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 && (left.kind === 194 || left.kind === 193)) { + if (operator === 62 && (left.kind === 193 || left.kind === 192)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104); } var leftType; @@ -50744,7 +50717,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; @@ -50784,13 +50757,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 || node.kind === 218; + return node.kind === 199 || node.kind === 217; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, undefined, 0) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 && + return ts.isParameter(declaration) && declaration.name.kind === 190 && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -50800,7 +50773,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -50829,7 +50802,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128) { + if (contextualType.flags & 58982400) { var constraint = getBaseConstraintOfType(contextualType) || unknownType; return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 128) || maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 256) || @@ -50858,14 +50831,14 @@ var ts; getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node)); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 155) { + if (node.name.kind === 154) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 155) { + if (node.name.kind === 154) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -51059,11 +51032,11 @@ var ts; return type; } function checkConstEnumAccess(node, type) { - var ok = (node.parent.kind === 195 && node.parent.expression === node) || - (node.parent.kind === 196 && node.parent.expression === node) || - ((node.kind === 75 || node.kind === 154) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 && node.parent.exprName === node)) || - (node.parent.kind === 264); + var ok = (node.parent.kind === 194 && node.parent.expression === node) || + (node.parent.kind === 195 && node.parent.expression === node) || + ((node.kind === 75 || node.kind === 153) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 && node.parent.exprName === node)) || + (node.parent.kind === 263); 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_or_type_query); } @@ -51086,9 +51059,9 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 215: + case 214: + case 201: case 202: - case 203: cancellationToken.throwIfCancellationRequested(); } } @@ -51114,77 +51087,77 @@ var ts; return trueType; case 91: return falseType; - case 212: + case 211: return checkTemplateExpression(node); case 13: return globalRegExpType; - case 193: + case 192: return checkArrayLiteral(node, checkMode, forceTuple); - case 194: + case 193: return checkObjectLiteral(node, checkMode); - case 195: + case 194: return checkPropertyAccessExpression(node); - case 154: + case 153: return checkQualifiedName(node); - case 196: + case 195: return checkIndexedAccess(node); - case 197: + case 196: if (node.expression.kind === 96) { return checkImportCallExpression(node); } - case 198: + case 197: return checkCallExpression(node, checkMode); - case 199: + case 198: return checkTaggedTemplateExpression(node); - case 201: - return checkParenthesizedExpression(node, checkMode); - case 215: - return checkClassExpression(node); - case 202: - case 203: - return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205: - return checkTypeOfExpression(node); case 200: - case 218: - return checkAssertion(node); - case 219: - return checkNonNullAssertion(node); - case 220: - return checkMetaProperty(node); - case 204: - return checkDeleteExpression(node); - case 206: - return checkVoidExpression(node); - case 207: - return checkAwaitExpression(node); - case 208: - return checkPrefixUnaryExpression(node); - case 209: - return checkPostfixUnaryExpression(node); - case 210: - return checkBinaryExpression(node, checkMode); - case 211: - return checkConditionalExpression(node, checkMode); + return checkParenthesizedExpression(node, checkMode); case 214: - return checkSpreadExpression(node, checkMode); - case 216: - return undefinedWideningType; + return checkClassExpression(node); + case 201: + case 202: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 204: + return checkTypeOfExpression(node); + case 199: + case 217: + return checkAssertion(node); + case 218: + return checkNonNullAssertion(node); + case 219: + return checkMetaProperty(node); + case 203: + return checkDeleteExpression(node); + case 205: + return checkVoidExpression(node); + case 206: + return checkAwaitExpression(node); + case 207: + return checkPrefixUnaryExpression(node); + case 208: + return checkPostfixUnaryExpression(node); + case 209: + return checkBinaryExpression(node, checkMode); + case 210: + return checkConditionalExpression(node, checkMode); case 213: + return checkSpreadExpression(node, checkMode); + case 215: + return undefinedWideningType; + case 212: return checkYieldExpression(node); - case 221: + case 220: return node.type; - case 277: + case 276: return checkJsxExpression(node, checkMode); - case 267: + case 266: return checkJsxElement(node, checkMode); - case 268: + case 267: return checkJsxSelfClosingElement(node, checkMode); - case 271: + case 270: return checkJsxFragment(node); - case 275: + case 274: return checkJsxAttributes(node, checkMode); - case 269: + case 268: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -51214,10 +51187,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92)) { - if (!(func.kind === 163 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -51228,13 +51201,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 || func.kind === 167 || func.kind === 172) { + if (func.kind === 162 || func.kind === 166 || func.kind === 171) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203) { + if (func.kind === 202) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 || func.kind === 165) { + if (func.kind === 163 || func.kind === 164) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -51288,13 +51261,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203: - case 166: - case 245: case 202: - case 171: - case 162: + case 165: + case 244: + case 201: + case 170: case 161: + case 160: var parent = node.parent; if (node === parent.type) { return parent; @@ -51312,7 +51285,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 || name.kind === 190) { + else if (name.kind === 190 || name.kind === 189) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -51320,12 +51293,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 168) { + if (node.kind === 167) { checkGrammarIndexSignature(node); } - else if (node.kind === 171 || node.kind === 245 || node.kind === 172 || - node.kind === 166 || node.kind === 163 || - node.kind === 167) { + else if (node.kind === 170 || node.kind === 244 || node.kind === 171 || + node.kind === 165 || node.kind === 162 || + node.kind === 166) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -51350,10 +51323,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167: + case 166: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166: + case 165: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -51377,7 +51350,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 && node.kind !== 301) { + if (node.kind !== 167 && node.kind !== 300) { registerForUnusedIdentifiersCheck(node); } } @@ -51388,7 +51361,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163) { + if (member.kind === 162) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -51408,16 +51381,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164: + case 163: addName(names, name, memberName, 1); break; - case 165: + case 164: addName(names, name, memberName, 2); break; - case 160: + case 159: addName(names, name, memberName, 3); break; - case 162: + case 161: addName(names, name, memberName, 8); break; } @@ -51469,7 +51442,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159) { + if (member.kind === 158) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -51494,7 +51467,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247) { + if (node.kind === 246) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -51509,7 +51482,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144: + case 143: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -51517,7 +51490,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141: + case 140: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -51553,7 +51526,7 @@ var ts; error(node, ts.Diagnostics.A_method_cannot_be_named_with_a_private_identifier); } checkFunctionOrMethodDeclaration(node); - if (ts.hasModifier(node, 128) && node.kind === 162 && node.body) { + if (ts.hasModifier(node, 128) && node.kind === 161 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -51577,7 +51550,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 && + return n.kind === 159 && !ts.hasModifier(n, 32) && !!n.initializer; } @@ -51597,7 +51570,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -51621,21 +51594,21 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164) { + if (node.kind === 163) { if (!(node.flags & 8388608) && ts.nodeIsPresent(node.body) && (node.flags & 256)) { if (!(node.flags & 512)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 155) { + if (node.name.kind === 154) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { error(node.name, ts.Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier); } if (!hasNonBindableDynamicName(node)) { - var otherKind = node.kind === 164 ? 165 : 164; + var otherKind = node.kind === 163 ? 164 : 163; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -51651,7 +51624,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164) { + if (node.kind === 163) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -51699,7 +51672,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -51744,7 +51717,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178) { + if (e.kind === 177) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -51753,7 +51726,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177) { + else if (e.kind === 176) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -51773,7 +51746,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) { - if (accessNode.kind === 196 && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -51822,7 +51795,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -51837,9 +51810,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 247 && - n.parent.kind !== 246 && - n.parent.kind !== 215 && + if (n.parent.kind !== 246 && + n.parent.kind !== 245 && + n.parent.kind !== 214 && n.flags & 8388608) { if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { flags |= 1; @@ -51920,7 +51893,7 @@ var ts; ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 || node.kind === 161) && + var reportError = (node.kind === 161 || node.kind === 160) && ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -51954,14 +51927,14 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608; - var inAmbientContextOrInterface = node.parent.kind === 247 || node.parent.kind === 174 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 || node.parent.kind === 173 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if ((node.kind === 246 || node.kind === 215) && !inAmbientContext) { + if ((node.kind === 245 || node.kind === 214) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 || node.kind === 162 || node.kind === 161 || node.kind === 163) { + if (node.kind === 244 || node.kind === 161 || node.kind === 160 || node.kind === 162) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -52079,38 +52052,38 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { + case 246: case 247: - case 248: - case 323: + case 322: + case 315: case 316: - case 317: return 2; - case 250: + case 249: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4 | 1 : 4; - case 246: - case 249: - case 285: + case 245: + case 248: + case 284: return 2 | 1; - case 291: + case 290: return 2 | 1 | 4; - case 260: + case 259: if (!ts.isEntityNameExpression(d.expression)) { return 1; } d = d.expression; - case 254: - case 257: + case 253: case 256: + case 255: var result_8 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243: - case 192: - case 245: - case 259: + case 242: + case 191: + case 244: + case 258: case 75: return 1; default: @@ -52130,9 +52103,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(false)) || - isReferenceToType(type, getGlobalPromiseLikeType(false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); if (isTypeAny(thenFunction)) { @@ -52162,46 +52134,14 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 ? type.awaitedType : type; - } function isThenableType(type) { var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152), 0).length > 0; } - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 | 67108864)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - if (type.flags & 134217728) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -52210,12 +52150,6 @@ var ts; mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - if (type.flags & 134217728) { - return type; - } - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -52306,22 +52240,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246: + case 245: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157: + case 156: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160: + case 159: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162: + case 161: + case 163: case 164: - case 165: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -52357,14 +52291,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180: case 179: + case 178: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181: + case 180: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183: + case 182: return getEntityNameForDecoratorMetadata(node.type); - case 170: + case 169: return node.typeName; } } @@ -52373,13 +52307,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183) { + while (typeNode.kind === 182) { typeNode = typeNode.type; } - if (typeNode.kind === 138) { + if (typeNode.kind === 137) { continue; } - if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 147)) { + if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 146)) { continue; } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -52415,13 +52349,13 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8); - if (node.kind === 157) { + if (node.kind === 156) { checkExternalEmitHelpers(firstDecorator, 32); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 246: + case 245: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -52430,23 +52364,23 @@ var ts; } } break; + case 163: case 164: - case 165: - var otherKind = node.kind === 164 ? 165 : 164; + var otherKind = node.kind === 163 ? 164 : 163; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162: + case 161: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160: + case 159: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157: + case 156: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -52505,7 +52439,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 ? node.name.right : node.name)); } } } @@ -52546,7 +52480,7 @@ var ts; switch (node.kind) { case 75: return node; - case 195: + case 194: return node.name; default: return undefined; @@ -52556,7 +52490,7 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var functionFlags = ts.getFunctionFlags(node); - if (node.name && node.name.kind === 155) { + if (node.name && node.name.kind === 154) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -52572,7 +52506,7 @@ var ts; } } } - var body = node.kind === 161 ? undefined : node.body; + var body = node.kind === 160 ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -52605,42 +52539,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246: - case 215: + case 245: + case 214: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291: - case 250: - case 224: - case 252: + case 290: + case 249: + case 223: + case 251: + case 230: case 231: case 232: - case 233: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163: - case 202: - case 245: - case 203: case 162: + case 201: + case 244: + case 202: + case 161: + case 163: case 164: - case 165: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161: + case 160: + case 165: case 166: - case 167: + case 170: case 171: - case 172: - case 248: case 247: + case 246: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182: + case 181: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -52660,11 +52594,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162: - case 160: + case 161: + case 159: + case 163: case 164: - case 165: - if (member.kind === 165 && member.symbol.flags & 32768) { + if (member.kind === 164 && member.symbol.flags & 32768) { break; } var symbol = getSymbolOfNode(member); @@ -52674,7 +52608,7 @@ var ts; addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163: + case 162: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { @@ -52682,8 +52616,8 @@ var ts; } } break; - case 168: - case 223: + case 167: + case 222: break; default: ts.Debug.fail(); @@ -52707,7 +52641,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) ? ts.rangeOfNode(parent) @@ -52784,7 +52718,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0, unuseds.length === 1 @@ -52802,7 +52736,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 && bindingPattern.parent.parent.kind === 244) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 && bindingPattern.parent.parent.kind === 243) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -52823,7 +52757,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -52837,21 +52771,21 @@ var ts; switch (name.kind) { case 75: return ts.idText(name); - case 191: case 190: + case 189: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 || node.kind === 259 || node.kind === 257; + return node.kind === 255 || node.kind === 258 || node.kind === 256; } function importClauseFromImported(decl) { - return decl.kind === 256 ? decl : decl.kind === 257 ? decl.parent : decl.parent.parent; + return decl.kind === 255 ? decl : decl.kind === 256 ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 224) { + if (node.kind === 223) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -52880,19 +52814,19 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 || - node.kind === 159 || - node.kind === 162 || + if (node.kind === 159 || + node.kind === 158 || node.kind === 161 || - node.kind === 164 || - node.kind === 165) { + node.kind === 160 || + node.kind === 163 || + node.kind === 164) { return false; } if (node.flags & 8388608) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -52944,7 +52878,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 291 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -52956,7 +52890,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 291 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { + if (parent.kind === 290 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -52964,7 +52898,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 243 && !node.initializer) { + if (node.kind === 242 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -52976,15 +52910,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244); - var container = varDeclList.parent.kind === 226 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243); + var container = varDeclList.parent.kind === 225 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 224 && ts.isFunctionLike(container.parent) || - container.kind === 251 || + (container.kind === 223 && ts.isFunctionLike(container.parent) || container.kind === 250 || - container.kind === 291); + container.kind === 249 || + container.kind === 290); if (!namesShareScope) { var name = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -53004,17 +52938,17 @@ var ts; if (!node.name) { return; } - if (node.name.kind === 155) { + if (node.name.kind === 154) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192) { - if (node.parent.kind === 190 && languageVersion < 99) { + if (node.kind === 191) { + if (node.parent.kind === 189 && languageVersion < 99) { checkExternalEmitHelpers(node, 4); } - if (node.propertyName && node.propertyName.kind === 155) { + if (node.propertyName && node.propertyName.kind === 154) { checkComputedPropertyName(node.propertyName); } var parent = node.parent.parent; @@ -53033,17 +52967,17 @@ var ts; } } if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 && languageVersion < 2 && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 && languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 157 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 && 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)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { var widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -53076,7 +53010,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, undefined); } } @@ -53100,9 +53034,9 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 && node.kind !== 159) { + if (node.kind !== 159 && node.kind !== 158) { checkExportsOnMergedDeclarations(node); - if (node.kind === 243 || node.kind === 192) { + if (node.kind === 242 || node.kind === 191) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -53114,7 +53048,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 || nextDeclaration.kind === 159 + var message = nextDeclaration.kind === 159 || nextDeclaration.kind === 158 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -53124,8 +53058,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 && right.kind === 243) || - (left.kind === 243 && right.kind === 157)) { + if ((left.kind === 156 && right.kind === 242) || + (left.kind === 242 && right.kind === 156)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -53161,7 +53095,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225) { + if (node.thenStatement.kind === 224) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -53224,12 +53158,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244) { + if (node.initializer && node.initializer.kind === 243) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244) { + if (node.initializer.kind === 243) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -53256,13 +53190,13 @@ var ts; else if (compilerOptions.downlevelIteration && languageVersion < 2) { checkExternalEmitHelpers(node, 256); } - if (node.initializer.kind === 244) { + if (node.initializer.kind === 243) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 193 || varExpr.kind === 194) { + if (varExpr.kind === 192 || varExpr.kind === 193) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { @@ -53281,7 +53215,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 244) { + if (node.initializer.kind === 243) { 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); @@ -53291,7 +53225,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 || varExpr.kind === 194) { + if (varExpr.kind === 192 || varExpr.kind === 193) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -53301,7 +53235,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access); } } - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 193200128)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 58982400)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -53745,7 +53679,7 @@ var ts; var isGenerator = !!(functionFlags & 1); var isAsync = !!(functionFlags & 2); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -53766,12 +53700,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165) { + if (func.kind === 164) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163) { + else if (func.kind === 162) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -53779,14 +53713,14 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); } } } - else if (func.kind !== 163 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } @@ -53811,7 +53745,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 279 && !hasDuplicateDefaultClause) { + if (clause.kind === 278 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -53820,7 +53754,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278) { + if (produceDiagnostics && clause.kind === 277) { var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; @@ -53847,7 +53781,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -53942,8 +53876,8 @@ var ts; } var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 || - name.kind === 155 || + (propDeclaration.kind === 209 || + name.kind === 154 || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -54008,7 +53942,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170) { + if (node.kind === 169) { var type = getTypeFromTypeReference(node); if (type.flags & 262144) { for (var i = index; i < typeParameters.length; i++) { @@ -54233,7 +54167,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 || d.kind === 247; + return d.kind === 245 || d.kind === 246; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -54264,7 +54198,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215) { + if (derivedClassDecl.kind === 214) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -54283,7 +54217,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { continue; } @@ -54296,7 +54230,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432) && !(baseDeclarationFlags & 128) @@ -54391,7 +54325,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 && + return node.kind === 159 && !ts.hasModifier(node, 32 | 128) && !node.exclamationToken && !node.initializer; @@ -54413,7 +54347,7 @@ var ts; checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -54510,7 +54444,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208: + case 207: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -54520,7 +54454,7 @@ var ts; } } break; - case 210: + case 209: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -54549,7 +54483,7 @@ var ts; case 8: checkGrammarNumericLiteral(expr); return +expr.text; - case 201: + case 200: return evaluate(expr.expression); case 75: var identifier = expr; @@ -54557,14 +54491,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196: case 195: + case 194: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { var name = void 0; - if (ex.kind === 195) { + if (ex.kind === 194) { name = ex.name.escapedText; } else { @@ -54594,8 +54528,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 || - node.kind === 195 && isConstantMemberAccess(node.expression) || - node.kind === 196 && isConstantMemberAccess(node.expression) && + node.kind === 194 && isConstantMemberAccess(node.expression) || + node.kind === 195 && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -54622,7 +54556,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 249) { + if (declaration.kind !== 248) { return false; } var enumDeclaration = declaration; @@ -54650,8 +54584,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 || - (declaration.kind === 245 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 || + (declaration.kind === 244 && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608)) { return declaration; } @@ -54709,7 +54643,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, 246); + var mergedClass = ts.getDeclarationOfKind(symbol, 245); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -54752,22 +54686,22 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226: + case 225: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; + case 259: case 260: - case 261: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; + case 253: case 254: - case 255: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192: - case 243: + case 191: + case 242: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -54776,12 +54710,12 @@ var ts; } break; } + case 245: + case 248: + case 244: case 246: case 249: - case 245: case 247: - case 250: - case 248: if (isGlobalAugmentation) { return; } @@ -54799,12 +54733,12 @@ var ts; switch (node.kind) { case 75: return node; - case 154: + case 153: do { node = node.left; } while (node.kind !== 75); return node; - case 195: + case 194: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -54823,9 +54757,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 ? + var inAmbientExternalModule = node.parent.kind === 250 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -54848,13 +54782,13 @@ var ts; (symbol.flags & 788968 ? 788968 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 ? + var message = node.kind === 263 ? 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)); } if (compilerOptions.isolatedModules - && node.kind === 264 + && node.kind === 263 && !node.parent.parent.isTypeOnly && !(target.flags & 111551) && !(node.flags & 8388608)) { @@ -54881,7 +54815,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257) { + if (importClause.namedBindings.kind === 256) { checkImportBinding(importClause.namedBindings); } else { @@ -54904,7 +54838,7 @@ var ts; if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266) { + if (node.moduleReference.kind !== 265) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551) { @@ -54944,10 +54878,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 && + var inAmbientExternalModule = node.parent.kind === 250 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 && !node.moduleSpecifier && node.flags & 8388608; - if (node.parent.kind !== 291 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -54964,14 +54898,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 || node.parent.kind === 251 || node.parent.kind === 250; + var isInAppropriateContext = node.parent.kind === 290 || node.parent.kind === 250 || node.parent.kind === 249; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -55024,8 +54958,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 291 ? node.parent : node.parent.parent; - if (container.kind === 250 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 ? node.parent : node.parent.parent; + if (container.kind === 249 && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -55127,164 +55061,164 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 250: - case 246: - case 247: + case 249: case 245: + case 246: + case 244: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 && kind <= 242 && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 && kind <= 241 && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156: + case 155: return checkTypeParameter(node); - case 157: + case 156: return checkParameter(node); - case 160: - return checkPropertyDeclaration(node); case 159: + return checkPropertyDeclaration(node); + case 158: return checkPropertySignature(node); + case 170: case 171: - case 172: + case 165: case 166: case 167: - case 168: return checkSignatureDeclaration(node); - case 162: case 161: + case 160: return checkMethodDeclaration(node); - case 163: + case 162: return checkConstructorDeclaration(node); + case 163: case 164: - case 165: return checkAccessorDeclaration(node); - case 170: - return checkTypeReferenceNode(node); case 169: + return checkTypeReferenceNode(node); + case 168: return checkTypePredicate(node); - case 173: + case 172: return checkTypeQuery(node); - case 174: + case 173: return checkTypeLiteral(node); - case 175: + case 174: return checkArrayType(node); - case 176: + case 175: return checkTupleType(node); - case 179: - case 180: - return checkUnionOrIntersectionType(node); - case 183: - case 177: case 178: - return checkSourceElement(node.type); - case 184: - return checkThisType(node); - case 185: - return checkTypeOperator(node); - case 181: - return checkConditionalType(node); + case 179: + return checkUnionOrIntersectionType(node); case 182: + case 176: + case 177: + return checkSourceElement(node.type); + case 183: + return checkThisType(node); + case 184: + return checkTypeOperator(node); + case 180: + return checkConditionalType(node); + case 181: return checkInferType(node); - case 189: + case 188: return checkImportType(node); - case 308: + case 307: return checkJSDocAugmentsTag(node); - case 309: + case 308: return checkJSDocImplementsTag(node); - case 323: - case 316: - case 317: - return checkJSDocTypeAliasTag(node); case 322: - return checkJSDocTemplateTag(node); + case 315: + case 316: + return checkJSDocTypeAliasTag(node); case 321: + return checkJSDocTemplateTag(node); + case 320: return checkJSDocTypeTag(node); - case 318: + case 317: return checkJSDocParameterTag(node); - case 301: + case 300: checkJSDocFunctionType(node); - case 299: case 298: - case 296: case 297: - case 305: + case 295: + case 296: + case 304: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302: + case 301: checkJSDocVariadicType(node); return; - case 295: + case 294: return checkSourceElement(node.type); - case 186: + case 185: return checkIndexedAccessType(node); - case 187: + case 186: return checkMappedType(node); - case 245: + case 244: return checkFunctionDeclaration(node); - case 224: - case 251: - return checkBlock(node); - case 226: - return checkVariableStatement(node); - case 227: - return checkExpressionStatement(node); - case 228: - return checkIfStatement(node); - case 229: - return checkDoStatement(node); - case 230: - return checkWhileStatement(node); - case 231: - return checkForStatement(node); - case 232: - return checkForInStatement(node); - case 233: - return checkForOfStatement(node); - case 234: - case 235: - return checkBreakOrContinueStatement(node); - case 236: - return checkReturnStatement(node); - case 237: - return checkWithStatement(node); - case 238: - return checkSwitchStatement(node); - case 239: - return checkLabeledStatement(node); - case 240: - return checkThrowStatement(node); - case 241: - return checkTryStatement(node); - case 243: - return checkVariableDeclaration(node); - case 192: - return checkBindingElement(node); - case 246: - return checkClassDeclaration(node); - case 247: - return checkInterfaceDeclaration(node); - case 248: - return checkTypeAliasDeclaration(node); - case 249: - return checkEnumDeclaration(node); + case 223: case 250: - return checkModuleDeclaration(node); - case 255: - return checkImportDeclaration(node); - case 254: - return checkImportEqualsDeclaration(node); - case 261: - return checkExportDeclaration(node); - case 260: - return checkExportAssignment(node); + return checkBlock(node); case 225: + return checkVariableStatement(node); + case 226: + return checkExpressionStatement(node); + case 227: + return checkIfStatement(node); + case 228: + return checkDoStatement(node); + case 229: + return checkWhileStatement(node); + case 230: + return checkForStatement(node); + case 231: + return checkForInStatement(node); + case 232: + return checkForOfStatement(node); + case 233: + case 234: + return checkBreakOrContinueStatement(node); + case 235: + return checkReturnStatement(node); + case 236: + return checkWithStatement(node); + case 237: + return checkSwitchStatement(node); + case 238: + return checkLabeledStatement(node); + case 239: + return checkThrowStatement(node); + case 240: + return checkTryStatement(node); case 242: + return checkVariableDeclaration(node); + case 191: + return checkBindingElement(node); + case 245: + return checkClassDeclaration(node); + case 246: + return checkInterfaceDeclaration(node); + case 247: + return checkTypeAliasDeclaration(node); + case 248: + return checkEnumDeclaration(node); + case 249: + return checkModuleDeclaration(node); + case 254: + return checkImportDeclaration(node); + case 253: + return checkImportEqualsDeclaration(node); + case 260: + return checkExportDeclaration(node); + case 259: + return checkExportAssignment(node); + case 224: + case 241: checkGrammarStatementInAmbientContext(node); return; - case 265: + case 264: return checkMissingDeclaration(node); } } @@ -55360,30 +55294,30 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { + case 196: case 197: case 198: - case 199: - case 158: - case 269: + case 157: + case 268: resolveUntypedCall(node); break; + case 201: case 202: - case 203: - case 162: case 161: + case 160: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; + case 163: case 164: - case 165: checkAccessorDeclaration(node); break; - case 215: + case 214: checkClassExpressionDeferred(node); break; - case 268: + case 267: checkJsxSelfClosingElementDeferred(node); break; - case 267: + case 266: checkJsxElementDeferred(node); break; } @@ -55510,27 +55444,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291: + case 290: if (!ts.isExternalOrCommonJsModule(location)) break; - case 250: + case 249: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475); break; - case 249: + case 248: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 215: + case 214: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } + case 245: case 246: - case 247: if (!isStatic) { copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968); } break; - case 202: + case 201: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -55568,32 +55502,32 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156: + case 155: + case 245: case 246: case 247: case 248: - case 249: return true; - case 256: + case 255: return node.isTypeOnly; - case 259: - case 264: + case 258: + case 263: return node.parent.parent.isTypeOnly; default: return false; } } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154) { + while (node.parent.kind === 153) { node = node.parent; } - return node.parent.kind === 170; + return node.parent.kind === 169; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195) { + while (node.parent.kind === 194) { node = node.parent; } - return node.parent.kind === 217; + return node.parent.kind === 216; } function forEachEnclosingClass(node, callback) { var result; @@ -55621,13 +55555,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154) { + while (nodeOnRightSide.parent.kind === 153) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254) { + if (nodeOnRightSide.parent.kind === 253) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260) { + if (nodeOnRightSide.parent.kind === 259) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -55653,7 +55587,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 && parent.qualifier === node) { + if (parent && parent.kind === 188 && parent.qualifier === node) { return parent; } return undefined; @@ -55663,7 +55597,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 && + name.parent.kind === 194 && name.parent === name.parent.parent.left) { if (!ts.isPrivateIdentifier(name)) { var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); @@ -55672,14 +55606,14 @@ var ts; } } } - if (name.parent.kind === 260 && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 && ts.isEntityNameExpression(name)) { var success = resolveEntityName(name, 111551 | 788968 | 1920 | 2097152, true); if (success && success !== unknownSymbol) { return success; } } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { - var importEqualsDeclaration = ts.getAncestor(name, 254); + var importEqualsDeclaration = ts.getAncestor(name, 253); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, true); } @@ -55696,7 +55630,7 @@ var ts; } if (isHeritageClauseElementIdentifier(name)) { var meaning = 0; - if (name.parent.kind === 217) { + if (name.parent.kind === 216) { meaning = 788968; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551; @@ -55711,10 +55645,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318) { + if (name.parent.kind === 317) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 && name.parent.parent.kind === 322) { + if (name.parent.kind === 155 && name.parent.parent.kind === 321) { ts.Debug.assert(!ts.isInJSFile(name)); var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -55730,12 +55664,12 @@ var ts; } return resolveEntityName(name, 111551, false, true); } - else if (name.kind === 195 || name.kind === 154) { + else if (name.kind === 194 || name.kind === 153) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195) { + if (name.kind === 194) { checkPropertyAccessExpression(name); } else { @@ -55745,16 +55679,16 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 ? 788968 : 1920; + var meaning = name.parent.kind === 169 ? 788968 : 1920; return resolveEntityName(name, meaning, false, true); } - if (name.parent.kind === 169) { + if (name.parent.kind === 168) { return resolveEntityName(name, 1); } return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291) { + if (node.kind === 290) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -55775,8 +55709,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 && - grandParent.kind === 190 && + else if (parent.kind === 191 && + grandParent.kind === 189 && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -55788,8 +55722,8 @@ var ts; switch (node.kind) { case 75: case 76: - case 195: - case 154: + case 194: + case 153: return getSymbolOfNameOrPropertyAccessExpression(node); case 104: var container = ts.getThisContainer(node, false); @@ -55802,20 +55736,20 @@ var ts; if (ts.isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 184: + case 183: return getTypeFromThisTypeNode(node).symbol; case 102: return checkExpression(node).symbol; - case 130: + case 129: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163) { + if (constructorDeclaration && constructorDeclaration.kind === 162) { return constructorDeclaration.parent.symbol; } return undefined; case 10: case 14: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 || node.parent.kind === 261) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 || node.parent.kind === 260) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -55835,7 +55769,7 @@ var ts; case 38: case 80: return getSymbolOfNode(node.parent); - case 189: + case 188: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -55844,7 +55778,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283) { + if (location && location.kind === 282) { return resolveEntityName(location.name, 111551 | 2097152); } return undefined; @@ -55903,16 +55837,16 @@ var ts; return errorType; } function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 || expr.kind === 193); - if (expr.parent.kind === 233) { + ts.Debug.assert(expr.kind === 193 || expr.kind === 192); + if (expr.parent.kind === 232) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 210) { + if (expr.parent.kind === 209) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 282) { + if (expr.parent.kind === 281) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -55947,7 +55881,7 @@ var ts; case 8: case 10: return getLiteralType(name.text); - case 155: + case 154: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288) ? nameType : stringType; default: @@ -56000,7 +55934,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -56042,7 +55976,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 291) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 290) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; @@ -56065,7 +55999,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -56080,7 +56014,7 @@ var ts; else if (nodeLinks_1.flags & 262144) { var isDeclaredInLoop = nodeLinks_1.flags & 524288; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 224 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 223 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -56116,19 +56050,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254: + case 253: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); + case 255: case 256: - case 257: - case 259: - case 264: + case 258: + case 263: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261: + case 260: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260: + case 259: return node.expression && node.expression.kind === 75 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -56137,7 +56071,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -56224,15 +56158,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285: + case 284: + case 194: case 195: - case 196: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285) { + if (node.kind === 284) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -56458,12 +56392,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); - var otherKind = accessor.kind === 165 ? 164 : 165; + var otherKind = accessor.kind === 164 ? 163 : 164; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -56479,7 +56413,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -56488,14 +56422,14 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 && node.parent.parent && node.parent.parent.kind === 280; + return node.parent && node.parent.kind === 216 && node.parent.parent && node.parent.parent.kind === 279; } function getTypeReferenceDirectivesForEntityName(node) { if (!fileToDirective) { return undefined; } var meaning = 788968 | 1920; - if ((node.kind === 75 && isInTypeQuery(node)) || (node.kind === 195 && !isInHeritageClause(node))) { + if ((node.kind === 75 && isInTypeQuery(node)) || (node.kind === 194 && !isInHeritageClause(node))) { meaning = 111551 | 1048576; } var symbol = resolveEntityName(node, meaning, true); @@ -56538,7 +56472,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -56565,12 +56499,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291); + return ts.getDeclarationOfKind(moduleSymbol, 290); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -56741,14 +56675,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 && !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 === 164 || node.kind === 165) { + else if (node.kind === 163 || node.kind === 164) { 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); @@ -56765,17 +56699,17 @@ var ts; var flags = 0; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139) { - if (node.kind === 159 || node.kind === 161) { + if (modifier.kind !== 138) { + if (node.kind === 158 || node.kind === 160) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168) { + if (node.kind === 167) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81: - if (node.kind !== 249) { + if (node.kind !== 248) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81)); } break; @@ -56795,7 +56729,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 || node.parent.kind === 291) { + else if (node.parent.kind === 250 || node.parent.kind === 290) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -56821,10 +56755,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 === 251 || node.parent.kind === 291) { + else if (node.parent.kind === 250 || node.parent.kind === 290) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157) { + else if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -56836,11 +56770,11 @@ var ts; flags |= 32; lastStatic = modifier; break; - case 139: + case 138: if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 && node.kind !== 159 && node.kind !== 168 && node.kind !== 157) { + else if (node.kind !== 159 && node.kind !== 158 && node.kind !== 167 && node.kind !== 156) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -56862,19 +56796,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157) { + else if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; case 84: - var container = node.parent.kind === 291 ? node.parent : node.parent.parent; - if (container.kind === 250 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 ? node.parent : node.parent.parent; + if (container.kind === 249 && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512; break; - case 131: + case 130: if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -56884,10 +56818,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157) { + else if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608) && node.parent.kind === 251) { + else if ((node.parent.flags & 8388608) && node.parent.kind === 250) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -56900,14 +56834,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246) { - if (node.kind !== 162 && - node.kind !== 160 && - node.kind !== 164 && - node.kind !== 165) { + if (node.kind !== 245) { + if (node.kind !== 161 && + node.kind !== 159 && + node.kind !== 163 && + node.kind !== 164) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 && ts.hasModifier(node.parent, 128))) { + if (!(node.parent.kind === 245 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -56929,7 +56863,7 @@ var ts; else if (flags & 2 || node.parent.flags & 8388608) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157) { + else if (node.kind === 156) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -56937,7 +56871,7 @@ var ts; break; } } - if (node.kind === 163) { + if (node.kind === 162) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -56952,13 +56886,13 @@ var ts; } return false; } - else if ((node.kind === 255 || node.kind === 254) && flags & 2) { + else if ((node.kind === 254 || node.kind === 253) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 && (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 === 157 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 156 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -56975,37 +56909,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164: - case 165: case 163: - case 160: - case 159: + case 164: case 162: + case 159: + case 158: case 161: - case 168: - case 250: - case 255: + case 160: + case 167: + case 249: case 254: - case 261: + case 253: case 260: + case 259: + case 201: case 202: - case 203: - case 157: + case 156: return false; default: - if (node.parent.kind === 251 || node.parent.kind === 291) { + if (node.parent.kind === 250 || node.parent.kind === 290) { return false; } switch (node.kind) { - case 245: + case 244: return nodeHasAnyModifiersExcept(node, 126); - case 246: + case 245: return nodeHasAnyModifiersExcept(node, 122); + case 246: + case 225: case 247: - case 226: - case 248: return true; - case 249: + case 248: return nodeHasAnyModifiersExcept(node, 81); default: ts.Debug.fail(); @@ -57018,10 +56952,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162: - case 245: + case 161: + case 244: + case 201: case 202: - case 203: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -57135,7 +57069,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 !== 144 && parameter.type.kind !== 141) { + if (parameter.type.kind !== 143 && parameter.type.kind !== 140) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 || type.flags & 8) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -57176,7 +57110,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216) { + if (arg.kind === 215) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -57250,20 +57184,20 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 155) { + if (node.kind !== 154) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 && computedPropertyName.expression.operatorToken.kind === 27) { + if (computedPropertyName.expression.kind === 209 && computedPropertyName.expression.operatorToken.kind === 27) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 || - node.kind === 202 || - node.kind === 162); + ts.Debug.assert(node.kind === 244 || + node.kind === 201 || + node.kind === 161); if (node.flags & 8388608) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -57282,7 +57216,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284) { + if (prop.kind === 283) { if (inDestructuring) { var expression = ts.skipParentheses(prop.expression); if (ts.isArrayLiteralExpression(expression) || ts.isObjectLiteralExpression(expression)) { @@ -57292,10 +57226,10 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155) { + if (name.kind === 154) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (name.kind === 76) { @@ -57304,29 +57238,29 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 126 || prop.kind !== 162) { + if (mod.kind !== 126 || prop.kind !== 161) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; switch (prop.kind) { - case 283: - checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); case 282: + checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); + case 281: checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8) { checkGrammarNumericLiteral(name); } currentKind = 4; break; - case 162: + case 161: currentKind = 8; break; - case 164: + case 163: currentKind = 1; break; - case 165: + case 164: currentKind = 2; break; default: @@ -57365,7 +57299,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276) { + if (attr.kind === 275) { continue; } var name = attr.name, initializer = attr.initializer; @@ -57375,7 +57309,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 && !initializer.expression) { + if (initializer && initializer.kind === 276 && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -57389,13 +57323,13 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768) === 0) { var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163) { + if (func && func.kind !== 162) { ts.Debug.assert((ts.getFunctionFlags(func) & 2) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -57406,7 +57340,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244) { + if (forInOrOfStatement.initializer.kind === 243) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -57414,20 +57348,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 + var diagnostic = forInOrOfStatement.kind === 231 ? 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 === 232 + var diagnostic = forInOrOfStatement.kind === 231 ? 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 === 232 + var diagnostic = forInOrOfStatement.kind === 231 ? 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); @@ -57452,11 +57386,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165) { + if (accessor.kind === 164) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -57474,21 +57408,21 @@ var ts; return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148) { - if (node.type.kind !== 145) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145)); + if (node.operator === 147) { + if (node.type.kind !== 144) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243: + case 242: var decl = parent; if (decl.name.kind !== 75) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -57500,13 +57434,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160: + case 159: if (!ts.hasModifier(parent, 32) || !ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159: + case 158: if (!ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -57515,9 +57449,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139) { - if (node.type.kind !== 175 && node.type.kind !== 176) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145)); + else if (node.operator === 138) { + if (node.type.kind !== 174 && node.type.kind !== 175) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144)); } } } @@ -57530,8 +57464,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162) { - if (node.parent.kind === 194) { + if (node.kind === 161) { + if (node.parent.kind === 193) { if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -57553,14 +57487,14 @@ var ts; if (node.flags & 8388608) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 && !node.body) { + else if (node.kind === 161 && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247) { + else if (node.parent.kind === 246) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174) { + else if (node.parent.kind === 173) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -57571,9 +57505,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239: + case 238: if (node.label && current.label.escapedText === node.label.escapedText) { - var isMisplacedContinueLabel = node.kind === 234 + var isMisplacedContinueLabel = node.kind === 233 && !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); @@ -57581,8 +57515,8 @@ var ts; return false; } break; - case 238: - if (node.kind === 235 && !node.label) { + case 237: + if (node.kind === 234 && !node.label) { return false; } break; @@ -57595,13 +57529,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 + var message = node.kind === 234 ? 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 === 235 + var message = node.kind === 234 ? 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); @@ -57624,12 +57558,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 && expr.operator === 40 && + expr.kind === 207 && expr.operator === 40 && expr.operand.kind === 8; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 || - expr.kind === 208 && expr.operator === 40 && + expr.kind === 207 && expr.operator === 40 && expr.operand.kind === 9; } function isSimpleLiteralEnumReference(expr) { @@ -57660,7 +57594,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 && node.parent.parent.kind !== 233) { + if (node.parent.parent.kind !== 231 && node.parent.parent.kind !== 232) { if (node.flags & 8388608) { checkAmbientInitializer(node); } @@ -57673,7 +57607,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 || !node.type || node.initializer || node.flags & 8388608)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 || !node.type || node.initializer || node.flags & 8388608)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -57730,15 +57664,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { + case 227: case 228: case 229: + case 236: case 230: - case 237: case 231: case 232: - case 233: return false; - case 239: + case 238: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -57822,7 +57756,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247) { + else if (node.parent.kind === 246) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -57830,7 +57764,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174) { + else if (node.parent.kind === 173) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -57847,13 +57781,13 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 247 || - node.kind === 248 || - node.kind === 255 || + if (node.kind === 246 || + node.kind === 247 || node.kind === 254 || - node.kind === 261 || - node.kind === 260 || node.kind === 253 || + node.kind === 260 || + node.kind === 259 || + node.kind === 252 || ts.hasModifier(node, 2 | 1 | 512)) { return false; } @@ -57862,7 +57796,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 === 226) { + if (ts.isDeclaration(decl) || decl.kind === 225) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -57879,7 +57813,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 224 || node.parent.kind === 251 || node.parent.kind === 291) { + if (node.parent.kind === 223 || node.parent.kind === 250 || node.parent.kind === 290) { var links_2 = getNodeLinks(node.parent); if (!links_2.hasReportedStatementInAmbientContext) { return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -57896,10 +57830,10 @@ var ts; if (languageVersion >= 1) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188)) { + else if (ts.isChildOfNodeWithKind(node, 187)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285)) { + else if (ts.isChildOfNodeWithKind(node, 284)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -58057,13 +57991,13 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 && declaration.kind !== 162) || + return (declaration.kind !== 244 && declaration.kind !== 161) || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259: - case 264: + case 258: + case 263: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -58071,13 +58005,13 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { + case 255: + case 253: case 256: - case 254: - case 257: - case 259: + case 258: return true; case 75: - return decl.parent.kind === 259; + return decl.parent.kind === 258; default: return false; } @@ -58321,7 +58255,7 @@ var ts; result.push(createModifier(89)); } if (flags & 2) { - result.push(createModifier(131)); + result.push(createModifier(130)); } if (flags & 512) { result.push(createModifier(84)); @@ -58345,7 +58279,7 @@ var ts; result.push(createModifier(120)); } if (flags & 64) { - result.push(createModifier(139)); + result.push(createModifier(138)); } if (flags & 256) { result.push(createModifier(126)); @@ -58354,7 +58288,7 @@ var ts; } ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; function createQualifiedName(left, right) { - var node = createSynthesizedNode(154); + var node = createSynthesizedNode(153); node.left = left; node.right = asName(right); return node; @@ -58373,7 +58307,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155); + var node = createSynthesizedNode(154); node.expression = parenthesizeForComputedName(expression); return node; } @@ -58385,7 +58319,7 @@ var ts; } ts.updateComputedPropertyName = updateComputedPropertyName; function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156); + var node = createSynthesizedNode(155); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -58401,7 +58335,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157); + var node = createSynthesizedNode(156); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -58425,7 +58359,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158); + var node = createSynthesizedNode(157); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -58437,7 +58371,7 @@ var ts; } ts.updateDecorator = updateDecorator; function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159); + var node = createSynthesizedNode(158); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -58457,7 +58391,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160); + var node = createSynthesizedNode(159); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58481,7 +58415,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161, typeParameters, parameters, type); + var node = createSignatureDeclaration(160, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -58498,7 +58432,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162); + var node = createSynthesizedNode(161); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -58555,7 +58489,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163); + var node = createSynthesizedNode(162); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -58575,7 +58509,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164); + var node = createSynthesizedNode(163); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58598,7 +58532,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165); + var node = createSynthesizedNode(164); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -58619,7 +58553,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166, typeParameters, parameters, type); + return createSignatureDeclaration(165, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -58627,7 +58561,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167, typeParameters, parameters, type); + return createSignatureDeclaration(166, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -58635,7 +58569,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168); + var node = createSynthesizedNode(167); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -58677,7 +58611,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169); + var node = createSynthesizedNode(168); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -58697,7 +58631,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170); + var node = createSynthesizedNode(169); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -58711,7 +58645,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171, typeParameters, parameters, type); + return createSignatureDeclaration(170, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -58719,7 +58653,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172, typeParameters, parameters, type); + return createSignatureDeclaration(171, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -58727,7 +58661,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173); + var node = createSynthesizedNode(172); node.exprName = exprName; return node; } @@ -58739,7 +58673,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174); + var node = createSynthesizedNode(173); node.members = createNodeArray(members); return node; } @@ -58751,7 +58685,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175); + var node = createSynthesizedNode(174); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -58763,7 +58697,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176); + var node = createSynthesizedNode(175); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -58775,7 +58709,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177); + var node = createSynthesizedNode(176); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -58787,7 +58721,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178); + var node = createSynthesizedNode(177); node.type = type; return node; } @@ -58799,7 +58733,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179, types); + return createUnionOrIntersectionTypeNode(178, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -58807,7 +58741,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180, types); + return createUnionOrIntersectionTypeNode(179, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -58826,7 +58760,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181); + var node = createSynthesizedNode(180); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -58844,7 +58778,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182); + var node = createSynthesizedNode(181); node.typeParameter = typeParameter; return node; } @@ -58856,7 +58790,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189); + var node = createSynthesizedNode(188); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -58874,7 +58808,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183); + var node = createSynthesizedNode(182); node.type = type; return node; } @@ -58886,12 +58820,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184); + return createSynthesizedNode(183); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135; + var node = createSynthesizedNode(184); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -58901,7 +58835,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186); + var node = createSynthesizedNode(185); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -58915,7 +58849,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187); + var node = createSynthesizedNode(186); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -58933,7 +58867,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188); + var node = createSynthesizedNode(187); node.literal = literal; return node; } @@ -58945,7 +58879,7 @@ var ts; } ts.updateLiteralTypeNode = updateLiteralTypeNode; function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190); + var node = createSynthesizedNode(189); node.elements = createNodeArray(elements); return node; } @@ -58957,7 +58891,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191); + var node = createSynthesizedNode(190); node.elements = createNodeArray(elements); return node; } @@ -58969,7 +58903,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192); + var node = createSynthesizedNode(191); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -58987,7 +58921,7 @@ var ts; } ts.updateBindingElement = updateBindingElement; function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193); + var node = createSynthesizedNode(192); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -59001,7 +58935,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194); + var node = createSynthesizedNode(193); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -59015,7 +58949,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(194); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072); @@ -59023,9 +58957,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } return node.expression !== expression || node.name !== name @@ -59034,7 +58967,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(194); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -59053,7 +58986,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(195); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -59070,7 +59003,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(195); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -59088,7 +59021,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197); + var node = createSynthesizedNode(196); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -59107,7 +59040,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197); + var node = createSynthesizedNode(196); node.flags |= 32; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -59127,7 +59060,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198); + var node = createSynthesizedNode(197); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -59143,7 +59076,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199); + var node = createSynthesizedNode(198); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -59166,7 +59099,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200); + var node = createSynthesizedNode(199); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -59180,7 +59113,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201); + var node = createSynthesizedNode(200); node.expression = expression; return node; } @@ -59192,7 +59125,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202); + var node = createSynthesizedNode(201); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -59216,7 +59149,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203); + var node = createSynthesizedNode(202); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -59238,7 +59171,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204); + var node = createSynthesizedNode(203); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -59250,7 +59183,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205); + var node = createSynthesizedNode(204); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -59262,7 +59195,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206); + var node = createSynthesizedNode(205); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -59274,7 +59207,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207); + var node = createSynthesizedNode(206); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -59286,7 +59219,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208); + var node = createSynthesizedNode(207); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -59299,7 +59232,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209); + var node = createSynthesizedNode(208); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -59312,7 +59245,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210); + var node = createSynthesizedNode(209); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); @@ -59329,7 +59262,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211); + var node = createSynthesizedNode(210); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -59349,7 +59282,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212); + var node = createSynthesizedNode(211); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -59446,7 +59379,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213); + var node = createSynthesizedNode(212); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 ? asteriskTokenOrExpression : expression; return node; @@ -59460,7 +59393,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214); + var node = createSynthesizedNode(213); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -59472,7 +59405,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215); + var node = createSynthesizedNode(214); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59493,11 +59426,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216); + return createSynthesizedNode(215); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217); + var node = createSynthesizedNode(216); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -59511,7 +59444,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218); + var node = createSynthesizedNode(217); node.expression = expression; node.type = type; return node; @@ -59525,19 +59458,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219); + var node = createSynthesizedNode(218); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218); + node.flags |= 32; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220); + var node = createSynthesizedNode(219); node.keywordToken = keywordToken; node.name = name; return node; @@ -59550,7 +59500,7 @@ var ts; } ts.updateMetaProperty = updateMetaProperty; function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222); + var node = createSynthesizedNode(221); node.expression = expression; node.literal = literal; return node; @@ -59564,11 +59514,11 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223); + return createSynthesizedNode(222); } ts.createSemicolonClassElement = createSemicolonClassElement; function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224); + var block = createSynthesizedNode(223); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -59582,7 +59532,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226); + var node = createSynthesizedNode(225); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -59597,11 +59547,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225); + return createSynthesizedNode(224); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227); + var node = createSynthesizedNode(226); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -59615,7 +59565,7 @@ var ts; ts.createStatement = createExpressionStatement; ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228); + var node = createSynthesizedNode(227); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -59631,7 +59581,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229); + var node = createSynthesizedNode(228); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -59645,7 +59595,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230); + var node = createSynthesizedNode(229); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -59659,7 +59609,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231); + var node = createSynthesizedNode(230); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -59677,7 +59627,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232); + var node = createSynthesizedNode(231); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -59693,7 +59643,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233); + var node = createSynthesizedNode(232); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -59711,7 +59661,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234); + var node = createSynthesizedNode(233); node.label = asName(label); return node; } @@ -59723,7 +59673,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235); + var node = createSynthesizedNode(234); node.label = asName(label); return node; } @@ -59735,7 +59685,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236); + var node = createSynthesizedNode(235); node.expression = expression; return node; } @@ -59747,7 +59697,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237); + var node = createSynthesizedNode(236); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -59761,7 +59711,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238); + var node = createSynthesizedNode(237); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -59775,7 +59725,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239); + var node = createSynthesizedNode(238); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -59789,7 +59739,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240); + var node = createSynthesizedNode(239); node.expression = expression; return node; } @@ -59801,7 +59751,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241); + var node = createSynthesizedNode(240); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -59817,11 +59767,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242); + return createSynthesizedNode(241); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(243); + var node = createSynthesizedNode(242); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -59837,7 +59787,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243); + var node = createSynthesizedNode(242); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -59856,7 +59806,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0; } - var node = createSynthesizedNode(244); + var node = createSynthesizedNode(243); node.flags |= flags & 3; node.declarations = createNodeArray(declarations); return node; @@ -59869,7 +59819,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245); + var node = createSynthesizedNode(244); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -59895,7 +59845,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246); + var node = createSynthesizedNode(245); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59917,7 +59867,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247); + var node = createSynthesizedNode(246); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59939,7 +59889,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248); + var node = createSynthesizedNode(247); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59959,7 +59909,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249); + var node = createSynthesizedNode(248); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -59978,7 +59928,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0; } - var node = createSynthesizedNode(250); + var node = createSynthesizedNode(249); node.flags |= flags & (16 | 4 | 1024); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -59997,7 +59947,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251); + var node = createSynthesizedNode(250); node.statements = createNodeArray(statements); return node; } @@ -60009,7 +59959,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252); + var node = createSynthesizedNode(251); node.clauses = createNodeArray(clauses); return node; } @@ -60021,7 +59971,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253); + var node = createSynthesizedNode(252); node.name = asName(name); return node; } @@ -60033,7 +59983,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254); + var node = createSynthesizedNode(253); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -60051,7 +60001,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255); + var node = createSynthesizedNode(254); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -60070,7 +60020,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256); + var node = createSynthesizedNode(255); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -60086,13 +60036,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257); + var node = createSynthesizedNode(256); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263); + var node = createSynthesizedNode(262); node.name = name; return node; } @@ -60110,7 +60060,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258); + var node = createSynthesizedNode(257); node.elements = createNodeArray(elements); return node; } @@ -60122,7 +60072,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259); + var node = createSynthesizedNode(258); node.propertyName = propertyName; node.name = name; return node; @@ -60136,7 +60086,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260); + var node = createSynthesizedNode(259); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -60154,7 +60104,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261); + var node = createSynthesizedNode(260); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -60178,7 +60128,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262); + var node = createSynthesizedNode(261); node.elements = createNodeArray(elements); return node; } @@ -60190,7 +60140,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264); + var node = createSynthesizedNode(263); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -60204,7 +60154,7 @@ var ts; } ts.updateExportSpecifier = updateExportSpecifier; function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266); + var node = createSynthesizedNode(265); node.expression = expression; return node; } @@ -60216,33 +60166,33 @@ var ts; } ts.updateExternalModuleReference = updateExternalModuleReference; function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295); + var node = createSynthesizedNode(294); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321, "type"); + var tag = createJSDocTag(320, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; } ts.createJSDocTypeTag = createJSDocTypeTag; function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319, "returns"); + var tag = createJSDocTag(318, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; } ts.createJSDocReturnTag = createJSDocReturnTag; function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320, "this"); + var tag = createJSDocTag(319, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318, "param"); + var tag = createJSDocTag(317, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -60251,11 +60201,11 @@ var ts; } ts.createJSDocParamTag = createJSDocParamTag; function createJSDocClassTag() { - return createJSDocTag(311, "class"); + return createJSDocTag(310, "class"); } ts.createJSDocClassTag = createJSDocClassTag; function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304); + var node = createSynthesizedNode(303); node.comment = comment; node.tags = tags; return node; @@ -60267,7 +60217,7 @@ var ts; return node; } function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267); + var node = createSynthesizedNode(266); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -60283,7 +60233,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268); + var node = createSynthesizedNode(267); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -60299,7 +60249,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269); + var node = createSynthesizedNode(268); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -60315,7 +60265,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270); + var node = createSynthesizedNode(269); node.tagName = tagName; return node; } @@ -60327,7 +60277,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271); + var node = createSynthesizedNode(270); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -60349,11 +60299,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272); + return createSynthesizedNode(271); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273); + return createSynthesizedNode(272); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -60365,7 +60315,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274); + var node = createSynthesizedNode(273); node.name = name; node.initializer = initializer; return node; @@ -60379,7 +60329,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275); + var node = createSynthesizedNode(274); node.properties = createNodeArray(properties); return node; } @@ -60391,7 +60341,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276); + var node = createSynthesizedNode(275); node.expression = expression; return node; } @@ -60403,7 +60353,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277); + var node = createSynthesizedNode(276); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -60416,7 +60366,7 @@ var ts; } ts.updateJsxExpression = updateJsxExpression; function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278); + var node = createSynthesizedNode(277); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -60430,7 +60380,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279); + var node = createSynthesizedNode(278); node.statements = createNodeArray(statements); return node; } @@ -60442,7 +60392,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280); + var node = createSynthesizedNode(279); node.token = token; node.types = createNodeArray(types); return node; @@ -60455,7 +60405,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281); + var node = createSynthesizedNode(280); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -60469,7 +60419,7 @@ var ts; } ts.updateCatchClause = updateCatchClause; function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282); + var node = createSynthesizedNode(281); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -60484,7 +60434,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283); + var node = createSynthesizedNode(282); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -60498,7 +60448,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284); + var node = createSynthesizedNode(283); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -60510,7 +60460,7 @@ var ts; } ts.updateSpreadAssignment = updateSpreadAssignment; function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285); + var node = createSynthesizedNode(284); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -60530,7 +60480,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291); + var updated = createSynthesizedNode(290); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -60604,28 +60554,28 @@ var ts; } ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326); + var node = createSynthesizedNode(325); node.original = original; setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330); + var node = createSynthesizedNode(329); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329); + var node = createSynthesizedNode(328); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327); + var node = createSynthesizedNode(326); node.expression = expression; node.original = original; setTextRange(node, original); @@ -60641,7 +60591,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328) { + if (node.kind === 327) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27) { @@ -60651,7 +60601,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328); + var node = createSynthesizedNode(327); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -60663,7 +60613,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331); + var node = createSynthesizedNode(330); node.expression = expression; node.thisArg = thisArg; return node; @@ -60678,7 +60628,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292); + var node = ts.createNode(291); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -60713,7 +60663,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293); + var node = ts.createNode(292); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -60846,10 +60796,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue": return 286; - case "prepend": return 287; - case "internal": return 289; - case "text": return 288; + case "prologue": return 285; + case "prepend": return 286; + case "internal": return 288; + case "text": return 287; case "emitHelpers": case "no-default-lib": case "reference": @@ -60867,14 +60817,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290, section.pos, section.end); + var node = ts.createNode(289, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294); + var node = ts.createNode(293); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -61037,7 +60987,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 291) { + if (node.kind === 290) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -61496,7 +61446,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -61515,13 +61465,13 @@ var ts; case 9: case 10: return false; - case 193: + case 192: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194: + case 193: return target.properties.length > 0; default: return true; @@ -61529,7 +61479,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7); + var callee = skipOuterExpressions(expression, 15); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -61548,7 +61498,7 @@ var ts; } else { switch (callee.kind) { - case 195: { + case 194: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); @@ -61560,7 +61510,7 @@ var ts; } break; } - case 196: { + case 195: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); @@ -61616,14 +61566,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { + case 163: case 164: - case 165: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282: + case 281: return createExpressionForPropertyAssignment(property, receiver); - case 283: + case 282: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162: + case 161: return createExpressionForMethodDeclaration(property, receiver); } } @@ -61828,7 +61778,7 @@ var ts; ts.ensureUseStrict = ensureUseStrict; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 201) { + if (skipped.kind === 200) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -61837,10 +61787,10 @@ var ts; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(210, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 && binaryOperatorPrecedence > 3) { return true; } var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); @@ -61848,7 +61798,7 @@ var ts; case -1: if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 - && operand.kind === 213) { + && operand.kind === 212) { return false; } return true; @@ -61887,7 +61837,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 && node.operatorToken.kind === 39) { + if (node.kind === 209 && node.operatorToken.kind === 39) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -61900,7 +61850,7 @@ var ts; return 0; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211, 57); + var conditionalPrecedence = ts.getOperatorPrecedence(210, 57); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1) { @@ -61921,8 +61871,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, false).kind) { - case 215: - case 202: + case 214: + case 201: needsParens = true; } } @@ -61932,9 +61882,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, true); switch (leftmostExpr.kind) { - case 197: + case 196: return ts.createParen(expression); - case 198: + case 197: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -61945,7 +61895,7 @@ var ts; function parenthesizeForAccess(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -61983,7 +61933,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210, 27); + var commaPrecedence = ts.getOperatorPrecedence(209, 27); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -61994,29 +61944,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 || kind === 203) { + if (kind === 201 || kind === 202) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4); + return recreateOuterExpressions(expression, mutableCall, 8); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind; - if (leftmostExpressionKind === 194 || leftmostExpressionKind === 202) { + if (leftmostExpressionKind === 193 || leftmostExpressionKind === 201) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 ? ts.createParenthesizedType(member) : member; + return member.kind === 180 ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { + case 178: case 179: - case 180: + case 170: case 171: - case 172: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -62024,9 +61974,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173: - case 185: - case 182: + case 172: + case 184: + case 181: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -62052,27 +62002,27 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209: + case 208: node = node.operand; continue; - case 210: + case 209: node = node.left; continue; - case 211: + case 210: node = node.condition; continue; - case 199: + case 198: node = node.tag; continue; - case 197: + case 196: if (stopAtCallExpressions) { return node; } - case 218: - case 196: + case 217: case 195: - case 219: - case 327: + case 194: + case 218: + case 326: node = node.expression; continue; } @@ -62081,68 +62031,56 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 194)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 193)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 && node.operatorToken.kind === 27 || - node.kind === 328; + return node.kind === 209 && node.operatorToken.kind === 27 || + node.kind === 327; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7; } + if (kinds === void 0) { kinds = 15; } switch (node.kind) { - case 201: - return (kinds & 1) !== 0; case 200: - case 218: - case 219: + return (kinds & 1) !== 0; + case 199: + case 217: return (kinds & 2) !== 0; - case 327: + case 218: return (kinds & 4) !== 0; + case 326: + return (kinds & 8) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7; } - var previousNode; - do { - previousNode = node; - if (kinds & 1) { - node = ts.skipParentheses(node); - } - if (kinds & 2) { - node = skipAssertions(node); - } - if (kinds & 4) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219) { + if (kinds === void 0) { kinds = 15; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201: return ts.updateParen(outerExpression, expression); - case 200: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219: return ts.updateNonNullExpression(outerExpression, expression); - case 327: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200: return ts.updateParen(outerExpression, expression); + case 199: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218: return ts.updateNonNullExpression(outerExpression, expression); + case 326: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { - return node.kind === 201 + return node.kind === 200 && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -62150,7 +62088,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7; } + if (kinds === void 0) { kinds = 15; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -62251,10 +62189,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 && node.importClause) { + if (node.kind === 254 && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 && node.moduleSpecifier) { + if (node.kind === 260 && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -62317,11 +62255,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282: + case 281: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283: + case 282: return bindingElement.name; - case 284: + case 283: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -62337,11 +62275,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157: - case 192: + case 156: + case 191: return bindingElement.dotDotDotToken; - case 214: - case 284: + case 213: + case 283: return bindingElement; } return undefined; @@ -62355,7 +62293,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192: + case 191: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; if (ts.isPrivateIdentifier(propertyName)) { @@ -62366,7 +62304,7 @@ var ts; : propertyName; } break; - case 282: + case 281: if (bindingElement.name) { var propertyName = bindingElement.name; if (ts.isPrivateIdentifier(propertyName)) { @@ -62377,7 +62315,7 @@ var ts; : propertyName; } break; - case 284: + case 283: if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); } @@ -62396,11 +62334,11 @@ var ts; } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { + case 189: case 190: - case 191: - case 193: + case 192: return name.elements; - case 194: + case 193: return name.properties; } } @@ -62439,11 +62377,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191: - case 193: - return convertToArrayAssignmentPattern(node); case 190: - case 194: + case 192: + return convertToArrayAssignmentPattern(node); + case 189: + case 193: return convertToObjectAssignmentPattern(node); } } @@ -62578,272 +62516,272 @@ var ts; return undefined; } var kind = node.kind; - if ((kind > 0 && kind <= 153) || kind === 184) { + if ((kind > 0 && kind <= 152) || kind === 183) { return node; } switch (kind) { case 75: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154: + case 153: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155: + case 154: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); - case 156: + case 155: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157: + case 156: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158: + case 157: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); - case 159: + case 158: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160: + case 159: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161: + case 160: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162: + case 161: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163: + case 162: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164: + case 163: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165: + case 164: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166: + case 165: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167: + case 166: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168: + case 167: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 169: + case 168: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170: + case 169: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171: + case 170: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172: + case 171: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173: + case 172: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174: + case 173: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175: + case 174: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176: + case 175: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177: + case 176: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178: + case 177: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179: + case 178: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180: + case 179: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181: + case 180: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182: + case 181: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189: - return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183: - return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185: - return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186: - return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187: - return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); case 188: + return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); + case 182: + return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 184: + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + case 185: + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); + case 186: + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 187: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); - case 190: + case 189: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191: + case 190: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192: + case 191: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); - case 193: + case 192: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194: + case 193: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195: + case 194: if (node.flags & 32) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196: + case 195: if (node.flags & 32) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197: + case 196: if (node.flags & 32) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198: + case 197: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199: + case 198: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200: + case 199: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201: + case 200: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202: + case 201: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203: + case 202: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204: + case 203: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205: + case 204: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206: + case 205: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207: + case 206: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208: + case 207: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209: + case 208: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210: + case 209: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211: + case 210: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212: + case 211: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213: + case 212: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214: + case 213: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215: + case 214: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217: + case 216: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218: + case 217: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219: + case 218: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220: + case 219: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 222: + case 221: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 224: + case 223: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226: + case 225: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227: + case 226: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228: + case 227: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229: + case 228: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230: + case 229: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231: + case 230: 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, ts.liftToBlock)); - case 232: + case 231: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233: + case 232: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234: + case 233: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235: + case 234: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236: + case 235: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237: + case 236: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238: + case 237: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239: + case 238: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240: + case 239: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241: + case 240: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243: + case 242: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244: + case 243: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245: + case 244: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246: + case 245: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247: + case 246: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248: + case 247: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249: + case 248: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250: + case 249: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251: + case 250: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252: + case 251: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253: + case 252: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254: + case 253: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255: + case 254: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256: + case 255: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257: + case 256: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263: - return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258: - return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260: - return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261: - return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); case 262: + return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); + case 257: + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 258: + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + case 259: + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 260: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); + case 261: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264: + case 263: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 266: + case 265: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); - case 267: + case 266: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268: + case 267: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269: + case 268: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270: + case 269: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271: + case 270: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274: + case 273: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275: + case 274: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276: + case 275: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277: + case 276: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 278: + case 277: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279: + case 278: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280: + case 279: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281: + case 280: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); - case 282: + case 281: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283: + case 282: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284: + case 283: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); - case 285: + case 284: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 291: + case 290: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 327: + case 326: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328: + case 327: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: return node; @@ -62870,52 +62808,52 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 153)) { + if ((kind > 0 && kind <= 152)) { return initial; } - if ((kind >= 169 && kind <= 188)) { + if ((kind >= 168 && kind <= 187)) { return initial; } var result = initial; switch (node.kind) { - case 223: - case 225: - case 216: - case 242: - case 326: + case 222: + case 224: + case 215: + case 241: + case 325: break; - case 154: + case 153: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155: + case 154: result = reduceNode(node.expression, cbNode, result); break; - case 157: + case 156: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158: + case 157: result = reduceNode(node.expression, cbNode, result); break; - case 159: + case 158: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160: + case 159: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162: + case 161: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -62924,69 +62862,69 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163: + case 162: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; + case 163: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; case 164: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); - break; - case 165: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; + case 189: case 190: - case 191: result = reduceNodes(node.elements, cbNodes, result); break; - case 192: + case 191: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 193: + case 192: result = reduceNodes(node.elements, cbNodes, result); break; - case 194: + case 193: result = reduceNodes(node.properties, cbNodes, result); break; - case 195: + case 194: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196: + case 195: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; + case 196: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; case 197: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; case 198: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); - break; - case 199: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200: + case 199: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202: + case 201: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -62994,266 +62932,266 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203: + case 202: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201: + case 200: + case 203: case 204: case 205: case 206: - case 207: + case 212: case 213: - case 214: - case 219: + case 218: result = reduceNode(node.expression, cbNode, result); break; + case 207: case 208: - case 209: result = reduceNode(node.operand, cbNode, result); break; - case 210: + case 209: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211: + case 210: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212: + case 211: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215: + case 214: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217: + case 216: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218: + case 217: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; - case 222: + case 221: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 224: + case 223: result = reduceNodes(node.statements, cbNodes, result); break; - case 226: + case 225: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227: + case 226: result = reduceNode(node.expression, cbNode, result); break; - case 228: + case 227: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229: + case 228: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; + case 229: + case 236: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.statement, cbNode, result); + break; case 230: - case 237: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.statement, cbNode, result); - break; - case 231: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; + case 231: case 232: - case 233: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236: - case 240: + case 235: + case 239: result = reduceNode(node.expression, cbNode, result); break; - case 238: + case 237: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239: + case 238: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241: + case 240: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243: + case 242: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244: + case 243: result = reduceNodes(node.declarations, cbNodes, result); break; + case 244: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.typeParameters, cbNodes, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); + result = reduceNode(node.body, cbNode, result); + break; case 245: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); - result = reduceNode(node.body, cbNode, result); + result = reduceNodes(node.heritageClauses, cbNodes, result); + result = reduceNodes(node.members, cbNodes, result); break; - case 246: + case 248: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.typeParameters, cbNodes, result); - result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; case 249: - result = reduceNodes(node.decorators, cbNodes, result); - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); - result = reduceNodes(node.members, cbNodes, result); - break; - case 250: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251: + case 250: result = reduceNodes(node.statements, cbNodes, result); break; - case 252: + case 251: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254: + case 253: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255: + case 254: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256: + case 255: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257: + case 256: result = reduceNode(node.name, cbNode, result); break; - case 263: - result = reduceNode(node.name, cbNode, result); - break; - case 258: case 262: + result = reduceNode(node.name, cbNode, result); + break; + case 257: + case 261: result = reduceNodes(node.elements, cbNodes, result); break; - case 259: - case 264: + case 258: + case 263: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260: + case 259: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261: + case 260: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 266: + case 265: result = reduceNode(node.expression, cbNode, result); break; - case 267: + case 266: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271: + case 270: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; + case 267: case 268: - case 269: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275: + case 274: result = reduceNodes(node.properties, cbNodes, result); break; - case 270: + case 269: result = reduceNode(node.tagName, cbNode, result); break; - case 274: + case 273: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; + case 275: + result = reduceNode(node.expression, cbNode, result); + break; case 276: result = reduceNode(node.expression, cbNode, result); break; case 277: result = reduceNode(node.expression, cbNode, result); - break; case 278: - result = reduceNode(node.expression, cbNode, result); - case 279: result = reduceNodes(node.statements, cbNodes, result); break; - case 280: + case 279: result = reduceNodes(node.types, cbNodes, result); break; - case 281: + case 280: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; - case 282: + case 281: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283: + case 282: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284: + case 283: result = reduceNode(node.expression, cbNode, result); break; - case 285: + case 284: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 291: + case 290: result = reduceNodes(node.statements, cbNodes, result); break; - case 327: + case 326: result = reduceNode(node.expression, cbNode, result); break; - case 328: + case 327: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -63306,7 +63244,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 217)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 216)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -63929,7 +63867,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -63978,7 +63916,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255: + case 254: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -63987,12 +63925,12 @@ var ts; hasImportDefault = true; } break; - case 254: - if (node.moduleReference.kind === 266) { + case 253: + if (node.moduleReference.kind === 265) { externalImports.push(node); } break; - case 261: + case 260: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -64019,12 +63957,12 @@ var ts; } } break; - case 260: + case 259: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 226: + case 225: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -64032,7 +63970,7 @@ var ts; } } break; - case 245: + case 244: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -64050,7 +63988,7 @@ var ts; } } break; - case 246: + case 245: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -64184,7 +64122,7 @@ var ts; && ts.hasStaticModifier(member) === isStatic; } function isInitializedProperty(member) { - return member.kind === 160 + return member.kind === 159 && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -64633,8 +64571,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; + context.enableSubstitution(194); context.enableSubstitution(195); - context.enableSubstitution(196); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -64647,14 +64585,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292) { + if (node.kind === 291) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294) { + if (prepend.kind === 293) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -64687,16 +64625,16 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 291: - case 252: + case 290: case 251: - case 224: + case 250: + case 223: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246: case 245: + case 244: if (ts.hasModifier(node, 2)) { break; } @@ -64704,7 +64642,7 @@ var ts; recordEmittedDeclarationInScope(node); } else { - ts.Debug.assert(node.kind === 246 || ts.hasModifier(node, 512)); + ts.Debug.assert(node.kind === 245 || ts.hasModifier(node, 512)); } if (ts.isClassDeclaration(node)) { currentNameScope = node; @@ -64726,10 +64664,10 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255: case 254: + case 253: + case 259: case 260: - case 261: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -64744,13 +64682,13 @@ var ts; return node; } switch (node.kind) { - case 255: - return visitImportDeclaration(node); case 254: + return visitImportDeclaration(node); + case 253: return visitImportEqualsDeclaration(node); - case 260: + case 259: return visitExportAssignment(node); - case 261: + case 260: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -64760,11 +64698,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 261 || + if (node.kind === 260 || + node.kind === 254 || node.kind === 255 || - node.kind === 256 || - (node.kind === 254 && - node.moduleReference.kind === 266)) { + (node.kind === 253 && + node.moduleReference.kind === 265)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -64777,16 +64715,16 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 163: - return visitConstructor(node); - case 160: - return visitPropertyDeclaration(node); - case 168: - case 164: - case 165: case 162: + return visitConstructor(node); + case 159: + return visitPropertyDeclaration(node); + case 167: + case 163: + case 164: + case 161: return visitorWorker(node); - case 223: + case 222: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -64814,92 +64752,92 @@ var ts; case 118: case 122: case 81: - case 131: - case 139: + case 130: + case 138: + case 174: case 175: case 176: case 177: - case 178: - case 174: - case 169: - case 156: - case 125: - case 149: - case 129: - case 144: - case 141: - case 138: - case 110: - case 145: - case 172: - case 171: case 173: + case 168: + case 155: + case 125: + case 148: + case 128: + case 143: + case 140: + case 137: + case 110: + case 144: + case 171: case 170: + case 172: + case 169: + case 178: case 179: case 180: - case 181: + case 182: case 183: case 184: case 185: case 186: case 187: - case 188: - case 168: - case 158: - case 248: - return undefined; - case 160: - return visitPropertyDeclaration(node); - case 253: - return undefined; - case 163: - return visitConstructor(node); - case 247: - return ts.createNotEmittedStatement(node); - case 246: - return visitClassDeclaration(node); - case 215: - return visitClassExpression(node); - case 280: - return visitHeritageClause(node); - case 217: - return visitExpressionWithTypeArguments(node); - case 162: - return visitMethodDeclaration(node); - case 164: - return visitGetAccessor(node); - case 165: - return visitSetAccessor(node); - case 245: - return visitFunctionDeclaration(node); - case 202: - return visitFunctionExpression(node); - case 203: - return visitArrowFunction(node); + case 167: case 157: - return visitParameter(node); + case 247: + return undefined; + case 159: + return visitPropertyDeclaration(node); + case 252: + return undefined; + case 162: + return visitConstructor(node); + case 246: + return ts.createNotEmittedStatement(node); + case 245: + return visitClassDeclaration(node); + case 214: + return visitClassExpression(node); + case 279: + return visitHeritageClause(node); + case 216: + return visitExpressionWithTypeArguments(node); + case 161: + return visitMethodDeclaration(node); + case 163: + return visitGetAccessor(node); + case 164: + return visitSetAccessor(node); + case 244: + return visitFunctionDeclaration(node); case 201: - return visitParenthesizedExpression(node); + return visitFunctionExpression(node); + case 202: + return visitArrowFunction(node); + case 156: + return visitParameter(node); case 200: - case 218: - return visitAssertionExpression(node); - case 197: - return visitCallExpression(node); - case 198: - return visitNewExpression(node); + return visitParenthesizedExpression(node); case 199: + case 217: + return visitAssertionExpression(node); + case 196: + return visitCallExpression(node); + case 197: + return visitNewExpression(node); + case 198: return visitTaggedTemplateExpression(node); - case 219: + case 218: return visitNonNullExpression(node); - case 249: + case 248: return visitEnumDeclaration(node); - case 226: + case 225: return visitVariableStatement(node); - case 243: + case 242: return visitVariableDeclaration(node); - case 250: + case 249: return visitModuleDeclaration(node); - case 254: + case 253: return visitImportEqualsDeclaration(node); default: return ts.visitEachChild(node, visitor, context); @@ -65115,12 +65053,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { + case 163: case 164: - case 165: return getAllDecoratorsOfAccessors(node, member); - case 162: + case 161: return getAllDecoratorsOfMethod(member); - case 160: + case 159: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -65199,7 +65137,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 160 + ? member.kind === 159 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -65283,22 +65221,22 @@ var ts; } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 + return kind === 161 + || kind === 163 || kind === 164 - || kind === 165 - || kind === 160; + || kind === 159; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 162; + return node.kind === 161; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246: - case 215: + case 245: + case 214: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162: + case 161: + case 163: case 164: - case 165: return true; } return false; @@ -65310,15 +65248,15 @@ var ts; } function serializeTypeOfNode(node) { switch (node.kind) { - case 160: - case 157: + case 159: + case 156: return serializeTypeNode(node.type); - case 165: case 164: + case 163: return serializeTypeNode(getAccessorTypeNode(node)); - case 246: - case 215: - case 162: + case 245: + case 214: + case 161: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -65350,7 +65288,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164) { + if (container && node.kind === 163) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -65373,30 +65311,30 @@ var ts; } switch (node.kind) { case 110: - case 147: + case 146: case 100: - case 138: + case 137: return ts.createVoidZero(); - case 183: + case 182: return serializeTypeNode(node.type); + case 170: case 171: - case 172: return ts.createIdentifier("Function"); + case 174: case 175: - case 176: return ts.createIdentifier("Array"); - case 169: - case 129: + case 168: + case 128: return ts.createIdentifier("Boolean"); - case 144: + case 143: return ts.createIdentifier("String"); - case 142: + case 141: return ts.createIdentifier("Object"); - case 188: + case 187: switch (node.literal.kind) { case 10: return ts.createIdentifier("String"); - case 208: + case 207: case 8: return ts.createIdentifier("Number"); case 9: @@ -65407,34 +65345,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141: + case 140: return ts.createIdentifier("Number"); - case 152: + case 151: return getGlobalBigIntNameWithFallback(); - case 145: + case 144: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170: + case 169: return serializeTypeReferenceNode(node); - case 180: case 179: + case 178: return serializeTypeList(node.types); - case 181: + case 180: return serializeTypeList([node.trueType, node.falseType]); - case 185: - if (node.operator === 139) { + case 184: + if (node.operator === 138) { return serializeTypeNode(node.type); } break; - case 173: + case 172: + case 185: case 186: - case 187: - case 174: + case 173: case 125: - case 149: - case 184: - case 189: + case 148: + case 183: + case 188: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -65445,13 +65383,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183) { + while (typeNode.kind === 182) { typeNode = typeNode.type; } - if (typeNode.kind === 138) { + if (typeNode.kind === 137) { continue; } - if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 147)) { + if (!strictNullChecks && (typeNode.kind === 100 || typeNode.kind === 146)) { continue; } var serializedIndividual = serializeTypeNode(typeNode); @@ -65532,7 +65470,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); return name; - case 154: + case 153: return serializeQualifiedNameAsExpression(node); } } @@ -65732,7 +65670,7 @@ var ts; return ts.updateTypeScriptVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6); if (ts.isAssertionExpression(innerExpression)) { var expression = ts.visitNode(node.expression, visitor, ts.isExpression); if (ts.length(ts.getLeadingCommentRangesOfNode(expression, currentSourceFile))) { @@ -65871,11 +65809,11 @@ var ts; function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, false, true)) - ], currentLexicalScope.kind === 291 ? 0 : 1)); + ], currentLexicalScope.kind === 290 ? 0 : 1)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 249) { + if (node.kind === 248) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -65941,7 +65879,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251) { + if (body.kind === 250) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -65965,13 +65903,13 @@ var ts; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); ts.setTextRange(block, blockLocation); - if (body.kind !== 251) { + if (body.kind !== 250) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250) { + if (moduleDeclaration.body.kind === 249) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -65999,7 +65937,7 @@ var ts; return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings, false) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 257) { + if (node.kind === 256) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -66145,15 +66083,15 @@ var ts; if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(75); - context.enableSubstitution(283); - context.enableEmitNotification(250); + context.enableSubstitution(282); + context.enableEmitNotification(249); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250; + return ts.getOriginalNode(node).kind === 249; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249; + return ts.getOriginalNode(node).kind === 248; } function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; @@ -66199,9 +66137,9 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 195: + case 194: return substitutePropertyAccessExpression(node); - case 196: + case 195: return substituteElementAccessExpression(node); } return node; @@ -66231,9 +66169,9 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 291) { - var substitute = (applicableSubstitutions & 2 && container.kind === 250) || - (applicableSubstitutions & 8 && container.kind === 249); + if (container && container.kind !== 290) { + var substitute = (applicableSubstitutions & 2 && container.kind === 249) || + (applicableSubstitutions & 8 && container.kind === 248); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } @@ -66351,40 +66289,40 @@ var ts; if (!(node.transformFlags & 4194304)) return node; switch (node.kind) { - case 215: - case 246: + case 214: + case 245: return visitClassLike(node); - case 160: + case 159: return visitPropertyDeclaration(node); - case 226: + case 225: return visitVariableStatement(node); - case 155: + case 154: return visitComputedPropertyName(node); - case 195: + case 194: return visitPropertyAccessExpression(node); - case 208: + case 207: return visitPrefixUnaryExpression(node); - case 209: + case 208: return visitPostfixUnaryExpression(node, false); - case 197: + case 196: return visitCallExpression(node); - case 210: + case 209: return visitBinaryExpression(node); case 76: return visitPrivateIdentifier(node); - case 227: + case 226: return visitExpressionStatement(node); - case 231: + case 230: return visitForStatement(node); - case 199: + case 198: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194: case 193: + case 192: return visitAssignmentPattern(node); default: return visitor(node); @@ -66398,17 +66336,17 @@ var ts; } function classElementVisitor(node) { switch (node.kind) { - case 163: - return undefined; - case 164: - case 165: case 162: + return undefined; + case 163: + case 164: + case 161: return ts.visitEachChild(node, classElementVisitor, context); - case 160: + case 159: return visitPropertyDeclaration(node); - case 155: + case 154: return visitComputedPropertyName(node); - case 223: + case 222: return node; default: return visitor(node); @@ -67019,31 +66957,31 @@ var ts; switch (node.kind) { case 126: return undefined; - case 207: + case 206: return visitAwaitExpression(node); - case 162: + case 161: return doWithContext(1 | 2, visitMethodDeclaration, node); - case 245: + case 244: return doWithContext(1 | 2, visitFunctionDeclaration, node); - case 202: + case 201: return doWithContext(1 | 2, visitFunctionExpression, node); - case 203: + case 202: return doWithContext(1, visitArrowFunction, node); - case 195: + case 194: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196: + case 195: if (capturedSuperProperties && node.expression.kind === 102) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164: - case 165: case 163: - case 246: - case 215: + case 164: + case 162: + case 245: + case 214: return doWithContext(1 | 2, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -67052,27 +66990,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226: + case 225: return visitVariableStatementInAsyncBody(node); - case 231: - return visitForStatementInAsyncBody(node); - case 232: - return visitForInStatementInAsyncBody(node); - case 233: - return visitForOfStatementInAsyncBody(node); - case 281: - return visitCatchClauseInAsyncBody(node); - case 224: - case 238: - case 252: - case 278: - case 279: - case 241: - case 229: case 230: - case 228: + return visitForStatementInAsyncBody(node); + case 231: + return visitForInStatementInAsyncBody(node); + case 232: + return visitForOfStatementInAsyncBody(node); + case 280: + return visitCatchClauseInAsyncBody(node); + case 223: case 237: - case 239: + case 251: + case 277: + case 278: + case 240: + case 228: + case 229: + case 227: + case 236: + case 238: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -67224,7 +67162,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203; + var isArrowFunction = node.kind === 202; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); @@ -67305,15 +67243,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(197); - context.enableSubstitution(195); context.enableSubstitution(196); - context.enableEmitNotification(246); - context.enableEmitNotification(162); - context.enableEmitNotification(164); - context.enableEmitNotification(165); + context.enableSubstitution(194); + context.enableSubstitution(195); + context.enableEmitNotification(245); + context.enableEmitNotification(161); context.enableEmitNotification(163); - context.enableEmitNotification(226); + context.enableEmitNotification(164); + context.enableEmitNotification(162); + context.enableEmitNotification(225); } } function onEmitNode(hint, node, emitCallback) { @@ -67345,11 +67283,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195: + case 194: return substitutePropertyAccessExpression(node); - case 196: + case 195: return substituteElementAccessExpression(node); - case 197: + case 196: return substituteCallExpression(node); } return node; @@ -67380,11 +67318,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 - || kind === 163 + return kind === 245 || kind === 162 - || kind === 164 - || kind === 165; + || kind === 161 + || kind === 163 + || kind === 164; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -67512,64 +67450,64 @@ var ts; return node; } switch (node.kind) { - case 207: - return visitAwaitExpression(node); - case 213: - return visitYieldExpression(node); - case 236: - return visitReturnStatement(node); - case 239: - return visitLabeledStatement(node); - case 194: - return visitObjectLiteralExpression(node); - case 210: - return visitBinaryExpression(node, noDestructuringValue); - case 281: - return visitCatchClause(node); - case 226: - return visitVariableStatement(node); - case 243: - return visitVariableDeclaration(node); - case 233: - return visitForOfStatement(node, undefined); - case 231: - return visitForStatement(node); case 206: + return visitAwaitExpression(node); + case 212: + return visitYieldExpression(node); + case 235: + return visitReturnStatement(node); + case 238: + return visitLabeledStatement(node); + case 193: + return visitObjectLiteralExpression(node); + case 209: + return visitBinaryExpression(node, noDestructuringValue); + case 280: + return visitCatchClause(node); + case 225: + return visitVariableStatement(node); + case 242: + return visitVariableDeclaration(node); + case 232: + return visitForOfStatement(node, undefined); + case 230: + return visitForStatement(node); + case 205: return visitVoidExpression(node); - case 163: - return doWithLexicalThis(visitConstructorDeclaration, node); case 162: + return doWithLexicalThis(visitConstructorDeclaration, node); + case 161: return doWithLexicalThis(visitMethodDeclaration, node); - case 164: + case 163: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165: + case 164: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245: + case 244: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202: - return doWithLexicalThis(visitFunctionExpression, node); - case 203: - return visitArrowFunction(node); - case 157: - return visitParameter(node); - case 227: - return visitExpressionStatement(node); case 201: + return doWithLexicalThis(visitFunctionExpression, node); + case 202: + return visitArrowFunction(node); + case 156: + return visitParameter(node); + case 226: + return visitExpressionStatement(node); + case 200: return visitParenthesizedExpression(node, noDestructuringValue); - case 199: + case 198: return visitTaggedTemplateExpression(node); - case 195: + case 194: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196: + case 195: if (capturedSuperProperties && node.expression.kind === 102) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246: - case 215: + case 245: + case 214: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -67602,7 +67540,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 && statement.awaitModifier) { + if (statement.kind === 232 && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -67614,7 +67552,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284) { + if (e.kind === 283) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -67623,7 +67561,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 + chunkObject = ts.append(chunkObject, e.kind === 281 ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -67636,7 +67574,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 16384) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194) { + if (objects.length && objects[0].kind !== 193) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -67956,15 +67894,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(197); - context.enableSubstitution(195); context.enableSubstitution(196); - context.enableEmitNotification(246); - context.enableEmitNotification(162); - context.enableEmitNotification(164); - context.enableEmitNotification(165); + context.enableSubstitution(194); + context.enableSubstitution(195); + context.enableEmitNotification(245); + context.enableEmitNotification(161); context.enableEmitNotification(163); - context.enableEmitNotification(226); + context.enableEmitNotification(164); + context.enableEmitNotification(162); + context.enableEmitNotification(225); } } function onEmitNode(hint, node, emitCallback) { @@ -67996,11 +67934,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195: + case 194: return substitutePropertyAccessExpression(node); - case 196: + case 195: return substituteElementAccessExpression(node); - case 197: + case 196: return substituteCallExpression(node); } return node; @@ -68031,11 +67969,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 - || kind === 163 + return kind === 245 || kind === 162 - || kind === 164 - || kind === 165; + || kind === 161 + || kind === 163 + || kind === 164; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -68125,7 +68063,7 @@ var ts; return node; } switch (node.kind) { - case 281: + case 280: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -68156,30 +68094,32 @@ var ts; return node; } switch (node.kind) { + case 194: case 195: case 196: - case 197: if (node.flags & 32) { var updated = visitOptionalExpression(node, false, false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210: + case 209: if (node.operatorToken.kind === 60) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204: + case 203: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -68207,7 +68147,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 + expression = node.kind === 194 ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -68220,10 +68160,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195: - case 196: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197: return visitNonOptionalCallExpression(node, captureThisArg); + case 200: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194: + case 195: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -68242,8 +68182,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { + case 194: case 195: - case 196: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -68253,11 +68193,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 + rightExpression = segment.kind === 194 ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197: + case 196: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -68345,13 +68285,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267: + case 266: return visitJsxElement(node, false); - case 268: + case 267: return visitJsxSelfClosingElement(node, false); - case 271: + case 270: return visitJsxFragment(node, false); - case 277: + case 276: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -68361,13 +68301,13 @@ var ts; switch (node.kind) { case 11: return visitJsxText(node); - case 277: + case 276: return visitJsxExpression(node); - case 267: + case 266: return visitJsxElement(node, true); - case 268: + case 267: return visitJsxSelfClosingElement(node, true); - case 271: + case 270: return visitJsxFragment(node, true); default: return ts.Debug.failBadSyntaxKind(node); @@ -68431,7 +68371,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277) { + else if (node.kind === 276) { if (node.expression === undefined) { return ts.createTrue(); } @@ -68491,7 +68431,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267) { + if (node.kind === 266) { return getTagName(node.openingElement); } else { @@ -68791,7 +68731,7 @@ var ts; return node; } switch (node.kind) { - case 210: + case 209: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -68881,13 +68821,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192) !== 0 - && node.kind === 236 + && node.kind === 235 && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 && (ts.isStatement(node) || (node.kind === 224))) + || (hierarchyFacts & 8192 && (ts.isStatement(node) || (node.kind === 223))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432) !== 0; } @@ -68909,63 +68849,63 @@ var ts; switch (node.kind) { case 120: return undefined; - case 246: - return visitClassDeclaration(node); - case 215: - return visitClassExpression(node); - case 157: - return visitParameter(node); case 245: + return visitClassDeclaration(node); + case 214: + return visitClassExpression(node); + case 156: + return visitParameter(node); + case 244: return visitFunctionDeclaration(node); - case 203: - return visitArrowFunction(node); case 202: + return visitArrowFunction(node); + case 201: return visitFunctionExpression(node); - case 243: + case 242: return visitVariableDeclaration(node); case 75: return visitIdentifier(node); - case 244: + case 243: return visitVariableDeclarationList(node); - case 238: + case 237: return visitSwitchStatement(node); - case 252: + case 251: return visitCaseBlock(node); - case 224: + case 223: return visitBlock(node, false); - case 235: case 234: - return visitBreakOrContinueStatement(node); - case 239: - return visitLabeledStatement(node); - case 229: - case 230: - return visitDoOrWhileStatement(node, undefined); - case 231: - return visitForStatement(node, undefined); - case 232: - return visitForInStatement(node, undefined); case 233: + return visitBreakOrContinueStatement(node); + case 238: + return visitLabeledStatement(node); + case 228: + case 229: + return visitDoOrWhileStatement(node, undefined); + case 230: + return visitForStatement(node, undefined); + case 231: + return visitForInStatement(node, undefined); + case 232: return visitForOfStatement(node, undefined); - case 227: + case 226: return visitExpressionStatement(node); - case 194: - return visitObjectLiteralExpression(node); - case 281: - return visitCatchClause(node); - case 283: - return visitShorthandPropertyAssignment(node); - case 155: - return visitComputedPropertyName(node); case 193: + return visitObjectLiteralExpression(node); + case 280: + return visitCatchClause(node); + case 282: + return visitShorthandPropertyAssignment(node); + case 154: + return visitComputedPropertyName(node); + case 192: return visitArrayLiteralExpression(node); - case 197: + case 196: return visitCallExpression(node); - case 198: + case 197: return visitNewExpression(node); - case 201: + case 200: return visitParenthesizedExpression(node, true); - case 210: + case 209: return visitBinaryExpression(node, true); case 14: case 15: @@ -68976,28 +68916,28 @@ var ts; return visitStringLiteral(node); case 8: return visitNumericLiteral(node); - case 199: + case 198: return visitTaggedTemplateExpression(node); - case 212: + case 211: return visitTemplateExpression(node); - case 213: + case 212: return visitYieldExpression(node); - case 214: + case 213: return visitSpreadElement(node); case 102: return visitSuperKeyword(false); case 104: return visitThisKeyword(node); - case 220: + case 219: return visitMetaProperty(node); - case 162: + case 161: return visitMethodDeclaration(node); + case 163: case 164: - case 165: return visitAccessorDeclaration(node); - case 226: + case 225: return visitVariableStatement(node); - case 236: + case 235: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -69082,14 +69022,14 @@ var ts; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 235 ? 2 : 4; + var jump = node.kind === 234 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235) { + if (node.kind === 234) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -69099,7 +69039,7 @@ var ts; } } else { - if (node.kind === 235) { + if (node.kind === 234) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker); } @@ -69285,17 +69225,17 @@ var ts; return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 236) { + if (statement.kind === 235) { return true; } - else if (statement.kind === 228) { + else if (statement.kind === 227) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 224) { + else if (statement.kind === 223) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -69403,7 +69343,7 @@ var ts; return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 && node.kind !== 203) { + if (hierarchyFacts & 32768 && node.kind !== 202) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -69422,18 +69362,18 @@ var ts; if (hierarchyFacts & 16384) { var newTarget = void 0; switch (node.kind) { - case 203: + case 202: return statements; - case 162: + case 161: + case 163: case 164: - case 165: newTarget = ts.createVoidZero(); break; - case 163: + case 162: newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); break; - case 245: - case 202: + case 244: + case 201: newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 98, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); break; default: @@ -69454,20 +69394,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223: + case 222: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162: + case 161: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; + case 163: case 164: - case 165: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163: + case 162: break; default: ts.Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -69602,7 +69542,7 @@ var ts; : enterSubtree(16286, 65); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 && !name && (node.kind === 245 || node.kind === 202)) { + if (hierarchyFacts & 16384 && !name && (node.kind === 244 || node.kind === 201)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152, 0); @@ -69633,7 +69573,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203); + ts.Debug.assert(node.kind === 202); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -69686,9 +69626,9 @@ var ts; } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 201: + case 200: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, false)); - case 210: + case 209: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -69696,9 +69636,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 201: + case 200: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 210: + case 209: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -69834,14 +69774,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { + case 228: case 229: - case 230: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231: + case 230: return visitForStatement(node, outermostLabeledStatement); - case 232: + case 231: return visitForInStatement(node, outermostLabeledStatement); - case 233: + case 232: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -69968,7 +69908,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155) { + if (property.name.kind === 154) { numInitialProperties = i; break; } @@ -70079,11 +70019,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232: return convertForInStatement(node, convertedLoopBody); - case 233: return convertForOfStatement(node, convertedLoopBody); - case 229: return convertDoStatement(node, convertedLoopBody); - case 230: return convertWhileStatement(node, convertedLoopBody); + case 230: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231: return convertForInStatement(node, convertedLoopBody); + case 232: return convertForOfStatement(node, convertedLoopBody); + case 228: return convertDoStatement(node, convertedLoopBody); + case 229: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -70107,11 +70047,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { + case 230: case 231: case 232: - case 233: var initializer = node.initializer; - if (initializer && initializer.kind === 244) { + if (initializer && initializer.kind === 243) { loopInitializer = initializer; } break; @@ -70370,20 +70310,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { + case 163: case 164: - case 165: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162: + case 161: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282: + case 281: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283: + case 282: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -70454,7 +70394,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164) { + if (node.kind === 163) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -70701,13 +70641,13 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(104); - context.enableEmitNotification(163); context.enableEmitNotification(162); + context.enableEmitNotification(161); + context.enableEmitNotification(163); context.enableEmitNotification(164); - context.enableEmitNotification(165); - context.enableEmitNotification(203); context.enableEmitNotification(202); - context.enableEmitNotification(245); + context.enableEmitNotification(201); + context.enableEmitNotification(244); } } function onSubstituteNode(hint, node) { @@ -70731,10 +70671,10 @@ var ts; } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192: - case 246: - case 249: - case 243: + case 191: + case 245: + case 248: + case 242: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -70795,11 +70735,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196) { return false; } var callTarget = statementExpression.expression; @@ -70807,7 +70747,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213) { return false; } var expression = callArgument.expression; @@ -70839,24 +70779,24 @@ var ts; if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269); - context.enableEmitNotification(270); context.enableEmitNotification(268); + context.enableEmitNotification(269); + context.enableEmitNotification(267); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195); - context.enableSubstitution(282); + context.enableSubstitution(194); + context.enableSubstitution(281); return ts.chainBundle(transformSourceFile); function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269: - case 270: case 268: + case 269: + case 267: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -70976,13 +70916,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229: + case 228: return visitDoStatement(node); - case 230: + case 229: return visitWhileStatement(node); - case 238: + case 237: return visitSwitchStatement(node); - case 239: + case 238: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -70990,24 +70930,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245: + case 244: return visitFunctionDeclaration(node); - case 202: + case 201: return visitFunctionExpression(node); + case 163: case 164: - case 165: return visitAccessorDeclaration(node); - case 226: + case 225: return visitVariableStatement(node); - case 231: + case 230: return visitForStatement(node); - case 232: + case 231: return visitForInStatement(node); - case 235: - return visitBreakStatement(node); case 234: + return visitBreakStatement(node); + case 233: return visitContinueStatement(node); - case 236: + case 235: return visitReturnStatement(node); default: if (node.transformFlags & 262144) { @@ -71023,21 +70963,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210: + case 209: return visitBinaryExpression(node); - case 211: + case 210: return visitConditionalExpression(node); - case 213: + case 212: return visitYieldExpression(node); - case 193: + case 192: return visitArrayLiteralExpression(node); - case 194: + case 193: return visitObjectLiteralExpression(node); - case 196: + case 195: return visitElementAccessExpression(node); - case 197: + case 196: return visitCallExpression(node); - case 198: + case 197: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -71045,9 +70985,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 245: + case 244: return visitFunctionDeclaration(node); - case 202: + case 201: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -71184,10 +71124,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195: + case 194: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196: + case 195: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -71388,35 +71328,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224: + case 223: return transformAndEmitBlock(node); - case 227: + case 226: return transformAndEmitExpressionStatement(node); - case 228: + case 227: return transformAndEmitIfStatement(node); - case 229: + case 228: return transformAndEmitDoStatement(node); - case 230: + case 229: return transformAndEmitWhileStatement(node); - case 231: + case 230: return transformAndEmitForStatement(node); - case 232: + case 231: return transformAndEmitForInStatement(node); - case 234: + case 233: return transformAndEmitContinueStatement(node); - case 235: + case 234: return transformAndEmitBreakStatement(node); - case 236: + case 235: return transformAndEmitReturnStatement(node); - case 237: + case 236: return transformAndEmitWithStatement(node); - case 238: + case 237: return transformAndEmitSwitchStatement(node); - case 239: + case 238: return transformAndEmitLabeledStatement(node); - case 240: + case 239: return transformAndEmitThrowStatement(node); - case 241: + case 240: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -71710,7 +71650,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 && defaultClauseIndex === -1) { + if (clause.kind === 278 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -71720,7 +71660,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278) { + if (clause.kind === 277) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -72536,11 +72476,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75); - context.enableSubstitution(210); - context.enableSubstitution(208); context.enableSubstitution(209); - context.enableSubstitution(283); - context.enableEmitNotification(291); + context.enableSubstitution(207); + context.enableSubstitution(208); + context.enableSubstitution(282); + context.enableEmitNotification(290); var moduleInfoMap = []; var deferredExports = []; var currentSourceFile; @@ -72731,23 +72671,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 255: - return visitImportDeclaration(node); case 254: + return visitImportDeclaration(node); + case 253: return visitImportEqualsDeclaration(node); - case 261: - return visitExportDeclaration(node); case 260: + return visitExportDeclaration(node); + case 259: return visitExportAssignment(node); - case 226: + case 225: return visitVariableStatement(node); - case 245: + case 244: return visitFunctionDeclaration(node); - case 246: + case 245: return visitClassDeclaration(node); - case 329: + case 328: return visitMergeDeclarationMarker(node); - case 330: + case 329: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -72772,24 +72712,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282: + case 281: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283: + case 282: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284: + case 283: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162: + case 161: + case 163: case 164: - case 165: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -73126,7 +73066,7 @@ var ts; } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -73158,10 +73098,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257: + case 256: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258: + case 257: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, true); @@ -73276,7 +73216,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291) { + if (node.kind === 290) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -73318,10 +73258,10 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 210: - return substituteBinaryExpression(node); case 209: + return substituteBinaryExpression(node); case 208: + case 207: return substituteUnaryExpression(node); } return node; @@ -73336,7 +73276,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291) { + if (exportContainer && exportContainer.kind === 290) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); @@ -73379,7 +73319,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 + var expression = node.kind === 208 ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 ? 63 : 64), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { @@ -73466,12 +73406,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75); - context.enableSubstitution(283); - context.enableSubstitution(210); - context.enableSubstitution(208); + context.enableSubstitution(282); context.enableSubstitution(209); - context.enableSubstitution(220); - context.enableEmitNotification(291); + context.enableSubstitution(207); + context.enableSubstitution(208); + context.enableSubstitution(219); + context.enableEmitNotification(290); var moduleInfoMap = []; var deferredExports = []; var exportFunctionsMap = []; @@ -73579,7 +73519,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 && externalImport.exportClause) { + if (externalImport.kind === 260 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -73602,7 +73542,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261) { + if (externalImport.kind !== 260) { continue; } if (!externalImport.exportClause) { @@ -73658,15 +73598,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 255: + case 254: if (!entry.importClause) { break; } - case 254: + case 253: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261: + case 260: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -73696,13 +73636,13 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 255: - return visitImportDeclaration(node); case 254: + return visitImportDeclaration(node); + case 253: return visitImportEqualsDeclaration(node); - case 261: - return visitExportDeclaration(node); case 260: + return visitExportDeclaration(node); + case 259: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -73827,7 +73767,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 2097152) === 0 - && (enclosingBlockScopedContainer.kind === 291 + && (enclosingBlockScopedContainer.kind === 290 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -73849,7 +73789,7 @@ var ts; : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -73888,10 +73828,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257: + case 256: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258: + case 257: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -73991,43 +73931,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 226: + case 225: return visitVariableStatement(node); - case 245: + case 244: return visitFunctionDeclaration(node); - case 246: + case 245: return visitClassDeclaration(node); - case 231: - return visitForStatement(node); - case 232: - return visitForInStatement(node); - case 233: - return visitForOfStatement(node); - case 229: - return visitDoStatement(node); case 230: + return visitForStatement(node); + case 231: + return visitForInStatement(node); + case 232: + return visitForOfStatement(node); + case 228: + return visitDoStatement(node); + case 229: return visitWhileStatement(node); - case 239: - return visitLabeledStatement(node); - case 237: - return visitWithStatement(node); case 238: + return visitLabeledStatement(node); + case 236: + return visitWithStatement(node); + case 237: return visitSwitchStatement(node); - case 252: + case 251: return visitCaseBlock(node); - case 278: + case 277: return visitCaseClause(node); - case 279: + case 278: return visitDefaultClause(node); - case 241: + case 240: return visitTryStatement(node); - case 281: + case 280: return visitCatchClause(node); - case 224: + case 223: return visitBlock(node); - case 329: + case 328: return visitMergeDeclarationMarker(node); - case 330: + case 329: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -74163,7 +74103,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291; + return container !== undefined && container.kind === 290; } else { return false; @@ -74178,7 +74118,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291) { + if (node.kind === 290) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -74214,7 +74154,7 @@ var ts; } function substituteUnspecified(node) { switch (node.kind) { - case 283: + case 282: return substituteShorthandPropertyAssignment(node); } return node; @@ -74238,12 +74178,12 @@ var ts; switch (node.kind) { case 75: return substituteExpressionIdentifier(node); - case 210: - return substituteBinaryExpression(node); - case 208: case 209: + return substituteBinaryExpression(node); + case 207: + case 208: return substituteUnaryExpression(node); - case 220: + case 219: return substituteMetaProperty(node); } return node; @@ -74295,14 +74235,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 + var expression = node.kind === 208 ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209) { + if (node.kind === 208) { expression = node.operator === 45 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -74325,7 +74265,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 291) { + if (exportContainer && exportContainer.kind === 290) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -74353,7 +74293,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291); + context.enableEmitNotification(290); context.enableSubstitution(75); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -74378,11 +74318,11 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254: + case 253: return undefined; - case 260: + case 259: return visitExportAssignment(node); - case 261: + case 260: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -74486,7 +74426,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 === 246) { + else if (node.parent.kind === 245) { 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 : @@ -74515,7 +74455,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246) { + else if (node.parent.kind === 245) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74562,15 +74502,15 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 || node.kind === 192) { + if (node.kind === 242 || node.kind === 191) { 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 === 160 || node.kind === 195 || node.kind === 159 || - (node.kind === 157 && ts.hasModifier(node.parent, 8))) { + else if (node.kind === 159 || node.kind === 194 || node.kind === 158 || + (node.kind === 156 && ts.hasModifier(node.parent, 8))) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74578,7 +74518,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 === 246 || node.kind === 157) { + else if (node.parent.kind === 245 || node.kind === 156) { 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 : @@ -74602,7 +74542,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165) { + if (node.kind === 164) { if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -74639,23 +74579,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167: + case 166: 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 166: + case 165: 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 168: + case 167: 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 162: case 161: + case 160: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74663,7 +74603,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 === 246) { + else if (node.parent.kind === 245) { 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 : @@ -74676,7 +74616,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245: + case 244: 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 : @@ -74701,27 +74641,27 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163: + case 162: 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 167: - case 172: + case 166: + case 171: 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 166: + case 165: 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 168: + case 167: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162: case 161: + case 160: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -74729,7 +74669,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 === 246) { + else if (node.parent.parent.kind === 245) { 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 : @@ -74741,15 +74681,15 @@ 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 245: - case 171: + case 244: + case 170: 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 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165: case 164: + case 163: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -74762,39 +74702,39 @@ var ts; function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 246: + case 245: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247: + case 246: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187: + case 186: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172: - case 167: + case 171: + case 166: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166: + case 165: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162: case 161: + case 160: 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 === 246) { + else if (node.parent.parent.kind === 245) { 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 171: - case 245: + case 170: + case 244: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248: + case 247: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -74808,7 +74748,7 @@ var ts; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 246) { + if (node.parent.parent.kind === 245) { diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 ? 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; @@ -74856,7 +74796,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157) { + if (parseTreeNode && parseTreeNode.kind === 156) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -75000,10 +74940,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 && node.isDeclarationFile) { + if (node.kind === 290 && node.isDeclarationFile) { return node; } - if (node.kind === 292) { + if (node.kind === 291) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -75026,14 +74966,14 @@ var ts; resultHasExternalModuleIndicator = false; needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], true, [], [], false, []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], true, [], [], false, []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false, []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294) { + if (prepend.kind === 293) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -75165,7 +75105,7 @@ var ts; return name; } else { - if (name.kind === 191) { + if (name.kind === 190) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -75173,7 +75113,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216) { + if (elem.kind === 215) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -75207,7 +75147,7 @@ var ts; if (shouldPrintWithInitializer(node)) { return; } - var shouldUseResolverType = node.kind === 157 && + var shouldUseResolverType = node.kind === 156 && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -75216,7 +75156,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125); } - if (node.kind === 165) { + if (node.kind === 164) { return ts.createKeywordTypeNode(125); } errorNameNode = node.name; @@ -75225,12 +75165,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 || node.kind === 192) { + if (node.kind === 242 || node.kind === 191) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 - || node.kind === 160 - || node.kind === 159) { + if (node.kind === 156 + || node.kind === 159 + || node.kind === 158) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -75247,19 +75187,19 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245: - case 250: - case 247: - case 246: - case 248: + case 244: case 249: + case 246: + case 245: + case 247: + case 248: return !resolver.isDeclarationVisible(node); - case 243: + case 242: return !getBindingNameVisible(node); + case 253: case 254: - case 255: - case 261: case 260: + case 259: return false; } return false; @@ -75336,7 +75276,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 && parent.kind !== 189); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 && parent.kind !== 188); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -75356,7 +75296,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266) { + if (decl.moduleReference.kind === 265) { var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, ts.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier))); } @@ -75376,7 +75316,7 @@ var ts; if (!decl.importClause.namedBindings) { return visibleDefaultBinding && ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257) { + if (decl.importClause.namedBindings.kind === 256) { var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; } @@ -75440,7 +75380,7 @@ var ts; var oldDiag = getSymbolAccessibilityDiagnostic; var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 || input.kind === 187) && input.parent.kind !== 248); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 || input.kind === 186) && input.parent.kind !== 247); if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) @@ -75459,71 +75399,71 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217: { + case 216: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170: { + case 169: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167: + case 166: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163: { - var ctor = ts.createSignatureDeclaration(163, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0), undefined); + case 162: { + var ctor = ts.createSignatureDeclaration(162, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0), undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162: { + case 161: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } - var sig = ts.createSignatureDeclaration(161, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164: { + case 163: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); return cleanup(ts.updateGetAccessor(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8)), ensureType(input, accessorType), undefined)); } - case 165: { + case 164: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updateSetAccessor(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8)), undefined)); } - case 160: - if (ts.isPrivateIdentifier(input.name)) { - return cleanup(undefined); - } - return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); case 159: + if (ts.isPrivateIdentifier(input.name)) { + return cleanup(undefined); + } + return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); + case 158: if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161: { + case 160: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166: { + case 165: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168: { + case 167: { return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125))); } - case 243: { + case 242: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -75531,13 +75471,13 @@ var ts; suppressNewDiagnosticContexts = true; return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156: { + case 155: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, undefined, undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181: { + case 180: { var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree); var oldEnclosingDecl = enclosingDeclaration; @@ -75547,13 +75487,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171: { + case 170: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172: { + case 171: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189: { + case 188: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -75582,7 +75522,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 161 && ts.hasModifier(node.parent, 8); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -75591,14 +75531,14 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261: { + case 260: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } resultHasScopeMarker = true; return ts.updateExportDeclaration(input, undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260: { + case 259: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -75613,7 +75553,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131)] : [], ts.createVariableDeclarationList([varDecl], 2)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130)] : [], ts.createVariableDeclarationList([varDecl], 2)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -75635,10 +75575,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254: { + case 253: { return transformImportEqualsDeclaration(input); } - case 255: { + case 254: { return transformImportDeclaration(input); } } @@ -75658,12 +75598,12 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248: + case 247: return cleanup(ts.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247: { + case 246: { return cleanup(ts.updateInterfaceDeclaration(input, undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245: { + case 244: { var clean = cleanup(ts.updateFunctionDeclaration(input, undefined, ensureModifiers(input), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined)); if (clean && resolver.isExpandoFunctionDeclaration(input)) { var props = resolver.getPropertiesOfContainerFunction(input); @@ -75700,10 +75640,10 @@ var ts; return clean; } } - case 250: { + case 249: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251) { + if (inner && inner.kind === 250) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -75739,7 +75679,7 @@ var ts; return cleanup(ts.updateModuleDeclaration(input, undefined, mods, input.name, body)); } } - case 246: { + case 245: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -75789,7 +75729,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131)] : [], ts.createVariableDeclarationList([varDecl], 2)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130)] : [], ts.createVariableDeclarationList([varDecl], 2)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -75807,10 +75747,10 @@ var ts; return cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226: { + case 225: { return cleanup(transformVariableStatement(input)); } - case 249: { + case 248: { return cleanup(ts.updateEnumDeclaration(input, undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -75827,7 +75767,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250) { + if (input.kind === 249) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -75848,7 +75788,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216) { + if (e.kind === 215) { return; } if (e.name) { @@ -75898,7 +75838,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 ^ (4 | 256); var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0; - var parentIsFile = node.parent.kind === 291; + var parentIsFile = node.parent.kind === 290; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2; additions = 0; @@ -75925,7 +75865,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247) { + if (node.kind === 246) { return true; } return false; @@ -75947,7 +75887,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 + return accessor.kind === 163 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -75956,52 +75896,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160: case 159: + case 158: return !ts.hasModifier(node, 8); - case 157: - case 243: + case 156: + case 242: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245: - case 250: - case 254: - case 247: - case 246: - case 248: + case 244: case 249: - case 226: - case 255: - case 261: + case 253: + case 246: + case 245: + case 247: + case 248: + case 225: + case 254: case 260: + case 259: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167: - case 163: - case 162: - case 164: - case 165: - case 160: - case 159: - case 161: case 166: - case 168: - case 243: - case 156: - case 217: + case 162: + case 161: + case 163: + case 164: + case 159: + case 158: + case 160: + case 165: + case 167: + case 242: + case 155: + case 216: + case 169: + case 180: case 170: - case 181: case 171: - case 172: - case 189: + case 188: return true; } return false; @@ -76103,7 +76043,7 @@ var ts; } ts.noEmitNotification = noEmitNotification; function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332); + var enabledSyntaxKindFeatures = new Array(331); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -76393,7 +76333,7 @@ var ts; ts.getOutputPathsForBundle = getOutputPathsForBundle; function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292) { + if (sourceFile.kind === 291) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -76699,7 +76639,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -76722,8 +76662,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -76761,7 +76701,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); + && (sourceFileOrBundle.kind !== 290 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); } function getSourceRoot(mapOptions) { var sourceRoot = ts.normalizeSlashes(mapOptions.sourceRoot || ""); @@ -76856,7 +76796,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291, 0, 0); + var sourceFile = ts.createNode(290, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -76868,7 +76808,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227, directive.pos, directive.end); + var statement = ts.createNode(226, directive.pos, directive.end); statement.expression = ts.createNode(10, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -77027,9 +76967,9 @@ var ts; break; } switch (node.kind) { - case 291: return printFile(node); - case 292: return printBundle(node); - case 293: return printUnparsedSource(node); + case 290: return printFile(node); + case 291: return printBundle(node); + case 292: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -77281,11 +77221,11 @@ var ts; return pipelineEmitWithSubstitution; } case 2: - if (!commentsDisabled && node.kind !== 291) { + if (!commentsDisabled && node.kind !== 290) { return pipelineEmitWithComments; } case 3: - if (!sourceMapsDisabled && node.kind !== 291 && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } case 4: @@ -77325,261 +77265,261 @@ var ts; case 16: case 17: return emitLiteral(node, false); - case 293: - case 287: - return emitUnparsedSourceOrPrepend(node); + case 292: case 286: + return emitUnparsedSourceOrPrepend(node); + case 285: return writeUnparsedNode(node); + case 287: case 288: - case 289: return emitUnparsedTextLike(node); - case 290: + case 289: return emitUnparsedSyntheticReference(node); case 75: return emitIdentifier(node); case 76: return emitPrivateIdentifier(node); - case 154: + case 153: return emitQualifiedName(node); - case 155: + case 154: return emitComputedPropertyName(node); - case 156: + case 155: return emitTypeParameter(node); - case 157: + case 156: return emitParameter(node); - case 158: + case 157: return emitDecorator(node); - case 159: + case 158: return emitPropertySignature(node); - case 160: + case 159: return emitPropertyDeclaration(node); - case 161: + case 160: return emitMethodSignature(node); - case 162: + case 161: return emitMethodDeclaration(node); - case 163: + case 162: return emitConstructor(node); + case 163: case 164: - case 165: return emitAccessorDeclaration(node); - case 166: + case 165: return emitCallSignature(node); - case 167: + case 166: return emitConstructSignature(node); - case 168: + case 167: return emitIndexSignature(node); - case 169: + case 168: return emitTypePredicate(node); - case 170: + case 169: return emitTypeReference(node); - case 171: + case 170: return emitFunctionType(node); - case 301: + case 300: return emitJSDocFunctionType(node); - case 172: + case 171: return emitConstructorType(node); - case 173: + case 172: return emitTypeQuery(node); - case 174: + case 173: return emitTypeLiteral(node); - case 175: + case 174: return emitArrayType(node); - case 176: + case 175: return emitTupleType(node); - case 177: + case 176: return emitOptionalType(node); - case 179: + case 178: return emitUnionType(node); - case 180: + case 179: return emitIntersectionType(node); - case 181: + case 180: return emitConditionalType(node); - case 182: + case 181: return emitInferType(node); - case 183: + case 182: return emitParenthesizedType(node); - case 217: + case 216: return emitExpressionWithTypeArguments(node); - case 184: + case 183: return emitThisType(); - case 185: + case 184: return emitTypeOperator(node); - case 186: + case 185: return emitIndexedAccessType(node); - case 187: + case 186: return emitMappedType(node); - case 188: + case 187: return emitLiteralType(node); - case 189: + case 188: return emitImportTypeNode(node); - case 296: + case 295: writePunctuation("*"); return; - case 297: + case 296: writePunctuation("?"); return; - case 298: + case 297: return emitJSDocNullableType(node); - case 299: + case 298: return emitJSDocNonNullableType(node); - case 300: + case 299: return emitJSDocOptionalType(node); - case 178: - case 302: + case 177: + case 301: return emitRestOrJSDocVariadicType(node); - case 190: + case 189: return emitObjectBindingPattern(node); - case 191: + case 190: return emitArrayBindingPattern(node); - case 192: + case 191: return emitBindingElement(node); - case 222: + case 221: return emitTemplateSpan(node); - case 223: + case 222: return emitSemicolonClassElement(); - case 224: + case 223: return emitBlock(node); - case 226: - return emitVariableStatement(node); case 225: + return emitVariableStatement(node); + case 224: return emitEmptyStatement(false); - case 227: + case 226: return emitExpressionStatement(node); - case 228: + case 227: return emitIfStatement(node); - case 229: + case 228: return emitDoStatement(node); - case 230: + case 229: return emitWhileStatement(node); - case 231: + case 230: return emitForStatement(node); - case 232: + case 231: return emitForInStatement(node); - case 233: + case 232: return emitForOfStatement(node); - case 234: + case 233: return emitContinueStatement(node); - case 235: + case 234: return emitBreakStatement(node); - case 236: + case 235: return emitReturnStatement(node); - case 237: + case 236: return emitWithStatement(node); - case 238: + case 237: return emitSwitchStatement(node); - case 239: + case 238: return emitLabeledStatement(node); - case 240: + case 239: return emitThrowStatement(node); - case 241: + case 240: return emitTryStatement(node); - case 242: + case 241: return emitDebuggerStatement(node); - case 243: + case 242: return emitVariableDeclaration(node); - case 244: + case 243: return emitVariableDeclarationList(node); - case 245: + case 244: return emitFunctionDeclaration(node); - case 246: + case 245: return emitClassDeclaration(node); - case 247: + case 246: return emitInterfaceDeclaration(node); - case 248: + case 247: return emitTypeAliasDeclaration(node); - case 249: + case 248: return emitEnumDeclaration(node); - case 250: + case 249: return emitModuleDeclaration(node); - case 251: + case 250: return emitModuleBlock(node); - case 252: + case 251: return emitCaseBlock(node); - case 253: + case 252: return emitNamespaceExportDeclaration(node); - case 254: + case 253: return emitImportEqualsDeclaration(node); - case 255: + case 254: return emitImportDeclaration(node); - case 256: + case 255: return emitImportClause(node); - case 257: + case 256: return emitNamespaceImport(node); - case 263: - return emitNamespaceExport(node); - case 258: - return emitNamedImports(node); - case 259: - return emitImportSpecifier(node); - case 260: - return emitExportAssignment(node); - case 261: - return emitExportDeclaration(node); case 262: + return emitNamespaceExport(node); + case 257: + return emitNamedImports(node); + case 258: + return emitImportSpecifier(node); + case 259: + return emitExportAssignment(node); + case 260: + return emitExportDeclaration(node); + case 261: return emitNamedExports(node); - case 264: + case 263: return emitExportSpecifier(node); - case 265: + case 264: return; - case 266: + case 265: return emitExternalModuleReference(node); case 11: return emitJsxText(node); + case 268: + case 271: + return emitJsxOpeningElementOrFragment(node); case 269: case 272: - return emitJsxOpeningElementOrFragment(node); - case 270: - case 273: return emitJsxClosingElementOrFragment(node); - case 274: + case 273: return emitJsxAttribute(node); - case 275: + case 274: return emitJsxAttributes(node); - case 276: + case 275: return emitJsxSpreadAttribute(node); - case 277: + case 276: return emitJsxExpression(node); - case 278: + case 277: return emitCaseClause(node); - case 279: + case 278: return emitDefaultClause(node); - case 280: + case 279: return emitHeritageClause(node); - case 281: + case 280: return emitCatchClause(node); - case 282: + case 281: return emitPropertyAssignment(node); - case 283: + case 282: return emitShorthandPropertyAssignment(node); - case 284: + case 283: return emitSpreadAssignment(node); - case 285: + case 284: return emitEnumMember(node); - case 318: - case 324: - return emitJSDocPropertyLikeTag(node); - case 319: - case 321: - case 320: case 317: - return emitJSDocSimpleTypedTag(node); - case 309: - case 308: - return emitJSDocHeritageTag(node); - case 322: - return emitJSDocTemplateTag(node); case 323: - return emitJSDocTypedefTag(node); + return emitJSDocPropertyLikeTag(node); + case 318: + case 320: + case 319: case 316: - return emitJSDocCallbackTag(node); - case 306: - return emitJSDocSignature(node); - case 305: - return emitJSDocTypeLiteral(node); - case 311: + return emitJSDocSimpleTypedTag(node); + case 308: case 307: - return emitJSDocSimpleTag(node); + return emitJSDocHeritageTag(node); + case 321: + return emitJSDocTemplateTag(node); + case 322: + return emitJSDocTypedefTag(node); + case 315: + return emitJSDocCallbackTag(node); + case 305: + return emitJSDocSignature(node); case 304: + return emitJSDocTypeLiteral(node); + case 310: + case 306: + return emitJSDocSimpleTag(node); + case 303: return emitJSDoc(node); } if (ts.isExpression(node)) { @@ -77611,69 +77551,69 @@ var ts; case 96: writeTokenNode(node, writeKeyword); return; - case 193: + case 192: return emitArrayLiteralExpression(node); - case 194: + case 193: return emitObjectLiteralExpression(node); - case 195: + case 194: return emitPropertyAccessExpression(node); - case 196: + case 195: return emitElementAccessExpression(node); - case 197: + case 196: return emitCallExpression(node); - case 198: + case 197: return emitNewExpression(node); - case 199: + case 198: return emitTaggedTemplateExpression(node); - case 200: + case 199: return emitTypeAssertionExpression(node); - case 201: + case 200: return emitParenthesizedExpression(node); - case 202: + case 201: return emitFunctionExpression(node); - case 203: + case 202: return emitArrowFunction(node); - case 204: + case 203: return emitDeleteExpression(node); - case 205: + case 204: return emitTypeOfExpression(node); - case 206: + case 205: return emitVoidExpression(node); - case 207: + case 206: return emitAwaitExpression(node); - case 208: + case 207: return emitPrefixUnaryExpression(node); - case 209: + case 208: return emitPostfixUnaryExpression(node); - case 210: + case 209: return emitBinaryExpression(node); - case 211: + case 210: return emitConditionalExpression(node); - case 212: + case 211: return emitTemplateExpression(node); - case 213: + case 212: return emitYieldExpression(node); - case 214: + case 213: return emitSpreadExpression(node); - case 215: + case 214: return emitClassExpression(node); - case 216: + case 215: return; - case 218: + case 217: return emitAsExpression(node); - case 219: + case 218: return emitNonNullExpression(node); - case 220: + case 219: return emitMetaProperty(node); - case 267: + case 266: return emitJsxElement(node); - case 268: + case 267: return emitJsxSelfClosingElement(node); - case 271: + case 270: return emitJsxFragment(node); - case 327: + case 326: return emitPartiallyEmittedExpression(node); - case 328: + case 327: return emitCommaList(node); } } @@ -77715,7 +77655,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 ? node : undefined; + var bundle = node.kind === 291 ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -77789,7 +77729,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 ? "text" : "internal"); } @@ -77852,7 +77792,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 && !node.name) { + if (node.parent && node.parent.kind === 300 && !node.name) { emit(node.type); } else { @@ -77910,7 +77850,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 ? "get" : "set"); + writeKeyword(node.kind === 163 ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -78090,7 +78030,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139) { + if (node.readonlyToken.kind !== 138) { writeKeyword("readonly"); } writeSpace(); @@ -78299,7 +78239,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 208 + return operand.kind === 207 && ((node.operator === 39 && (operand.operator === 39 || operand.operator === 45)) || (node.operator === 40 && (operand.operator === 40 || operand.operator === 46))); } @@ -78458,7 +78398,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228) { + if (node.elseStatement.kind === 227) { writeSpace(); emit(node.elseStatement); } @@ -78521,7 +78461,7 @@ var ts; emitTokenWithComment(20, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21, node.expression.end, writePunctuation, node); @@ -78529,7 +78469,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244) { + if (node.kind === 243) { emit(node); } else { @@ -78815,7 +78755,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250) { + while (body.kind === 249) { writePunctuation("."); emit(body.name); body = body.body; @@ -78860,7 +78800,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -78868,7 +78808,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146, node.pos, writeKeyword, node); + emitTokenWithComment(145, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -78908,7 +78848,7 @@ var ts; var nextPos = emitTokenWithComment(89, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -78920,7 +78860,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150, fromPos, writeKeyword, node); + emitTokenWithComment(149, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -78931,7 +78871,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -79124,7 +79064,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -79158,7 +79098,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295) { + if (tag.typeExpression.kind === 294) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -79177,7 +79117,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305) { + if (tag.typeExpression && tag.typeExpression.kind === 304) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -79932,7 +79872,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -79991,84 +79931,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224: + case 223: ts.forEach(node.statements, generateNames); break; - case 239: - case 237: + case 238: + case 236: + case 228: case 229: - case 230: generateNames(node.statement); break; - case 228: + case 227: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231: - case 233: + case 230: case 232: + case 231: generateNames(node.initializer); generateNames(node.statement); break; - case 238: + case 237: generateNames(node.caseBlock); break; - case 252: + case 251: ts.forEach(node.clauses, generateNames); break; + case 277: case 278: - case 279: ts.forEach(node.statements, generateNames); break; - case 241: + case 240: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281: + case 280: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226: + case 225: generateNames(node.declarationList); break; - case 244: + case 243: ts.forEach(node.declarations, generateNames); break; - case 243: - case 157: - case 192: - case 246: + case 242: + case 156: + case 191: + case 245: generateNameIfNeeded(node.name); break; - case 245: + case 244: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; + case 189: case 190: - case 191: ts.forEach(node.elements, generateNames); break; - case 255: + case 254: generateNames(node.importClause); break; - case 256: + case 255: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; + case 256: + generateNameIfNeeded(node.name); + break; + case 262: + generateNameIfNeeded(node.name); + break; case 257: - generateNameIfNeeded(node.name); - break; - case 263: - generateNameIfNeeded(node.name); - break; - case 258: ts.forEach(node.elements, generateNames); break; - case 259: + case 258: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -80077,12 +80017,12 @@ var ts; if (!node) return; switch (node.kind) { + case 281: case 282: - case 283: - case 160: - case 162: + case 159: + case 161: + case 163: case 164: - case 165: generateNameIfNeeded(node.name); break; } @@ -80216,23 +80156,23 @@ var ts; switch (node.kind) { case 75: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8)); - case 250: case 249: + case 248: return generateNameForModuleOrEnum(node); - case 255: - case 261: - return generateNameForImportOrExportDeclaration(node); - case 245: - case 246: + case 254: case 260: + return generateNameForImportOrExportDeclaration(node); + case 244: + case 245: + case 259: return generateNameForExportDefault(); - case 215: + case 214: return generateNameForClassExpression(); - case 162: + case 161: + case 163: case 164: - case 165: return generateNameForMethodOrAccessor(node); - case 155: + case 154: return makeTempVariableName(0, true); default: return makeTempVariableName(0); @@ -80270,7 +80210,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326; + var isEmittedNode = node.kind !== 325; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 11; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11; var savedContainerPos = containerPos; @@ -80285,7 +80225,7 @@ var ts; } if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024) !== 0)) { containerEnd = end; - if (node.kind === 244) { + if (node.kind === 243) { declarationListContainerEnd = end; } } @@ -80521,7 +80461,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 + if (node.kind !== 325 && (emitFlags & 16) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -80534,7 +80474,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 + if (node.kind !== 325 && (emitFlags & 32) === 0 && end >= 0) { emitSourcePos(source, end); @@ -82270,79 +82210,79 @@ var ts; return diagnostics; function walk(node, parent) { switch (parent.kind) { - case 157: - case 160: - case 162: + case 156: + case 159: + case 161: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } - case 161: + case 160: + case 162: case 163: case 164: - case 165: + case 201: + case 244: case 202: - case 245: - case 203: - case 243: + case 242: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 256: + case 255: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261: + case 260: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254: + case 253: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260: + case 259: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280: + case 279: var heritageClause = node; if (heritageClause.token === 113) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247: + case 246: var interfaceKeyword = ts.tokenToString(114); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250: - var moduleKeyword = node.flags & 16 ? ts.tokenToString(137) : ts.tokenToString(136); + case 249: + var moduleKeyword = node.flags & 16 ? ts.tokenToString(136) : ts.tokenToString(135); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248: + case 247: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249: + case 248: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219: + case 218: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218: + case 217: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200: + case 199: ts.Debug.fail(); } } @@ -82351,26 +82291,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246: - case 215: + case 245: + case 214: + case 161: case 162: case 163: case 164: - case 165: + case 201: + case 244: case 202: - case 245: - case 203: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } - case 226: + case 225: if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226); + checkModifiers(parent.modifiers, parent.kind === 225); return "skip"; } break; - case 160: + case 159: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -82381,18 +82321,18 @@ var ts; return "skip"; } break; - case 157: + case 156: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; + case 196: case 197: - case 198: - case 217: + case 216: + case 267: case 268: - case 269: - case 199: + case 198: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -82411,8 +82351,8 @@ var ts; case 119: case 117: case 118: - case 139: - case 131: + case 138: + case 130: case 122: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; diff --git a/lib/tsserver.js b/lib/tsserver.js index e3b0d8eefe4..6ee6efa77b8 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -3053,234 +3053,233 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3289,15 +3288,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3306,15 +3305,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3860,7 +3859,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -3889,10 +3887,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -3901,10 +3899,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -8058,8 +8056,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 152 /* BigIntKeyword */, - boolean: 129 /* BooleanKeyword */, + bigint: 151 /* BigIntKeyword */, + boolean: 128 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8067,9 +8065,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 130 /* ConstructorKeyword */, + _a["" + "constructor"] = 129 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 131 /* DeclareKeyword */, + _a.declare = 130 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8080,49 +8078,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 150 /* FromKeyword */, + _a.from = 149 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 132 /* GetKeyword */, + _a.get = 131 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 133 /* InferKeyword */, + _a.infer = 132 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 134 /* IsKeyword */, - _a.keyof = 135 /* KeyOfKeyword */, + _a.is = 133 /* IsKeyword */, + _a.keyof = 134 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 136 /* ModuleKeyword */, - _a.namespace = 137 /* NamespaceKeyword */, - _a.never = 138 /* NeverKeyword */, + _a.module = 135 /* ModuleKeyword */, + _a.namespace = 136 /* NamespaceKeyword */, + _a.never = 137 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 141 /* NumberKeyword */, - _a.object = 142 /* ObjectKeyword */, + _a.number = 140 /* NumberKeyword */, + _a.object = 141 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 139 /* ReadonlyKeyword */, - _a.require = 140 /* RequireKeyword */, - _a.global = 151 /* GlobalKeyword */, + _a.readonly = 138 /* ReadonlyKeyword */, + _a.require = 139 /* RequireKeyword */, + _a.global = 150 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 143 /* SetKeyword */, + _a.set = 142 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 144 /* StringKeyword */, + _a.string = 143 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 145 /* SymbolKeyword */, + _a.symbol = 144 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 146 /* TypeKeyword */, + _a.type = 145 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 147 /* UndefinedKeyword */, - _a.unique = 148 /* UniqueKeyword */, - _a.unknown = 149 /* UnknownKeyword */, + _a.undefined = 146 /* UndefinedKeyword */, + _a.unique = 147 /* UniqueKeyword */, + _a.unknown = 148 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8130,8 +8128,7 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.awaited = 128 /* AwaitedKeyword */, - _a.of = 153 /* OfKeyword */, + _a.of = 152 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -10485,9 +10482,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156 /* TypeParameter */) { + if (d && d.kind === 155 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { return current; } } @@ -10495,7 +10492,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10525,14 +10522,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243 /* VariableDeclaration */) { + if (node.kind === 242 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 244 /* VariableDeclarationList */) { + if (node && node.kind === 243 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226 /* VariableStatement */) { + if (node && node.kind === 225 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10681,30 +10678,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return expr.name; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10741,16 +10738,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: { + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 154 /* QualifiedName */) { + if (name.kind === 153 /* QualifiedName */) { return name.right; } break; } - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10766,15 +10763,15 @@ var ts; return undefined; } } - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 317 /* JSDocEnumTag */: + case 316 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11010,7 +11007,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11081,11 +11078,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 154 /* QualifiedName */; + return node.kind === 153 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155 /* ComputedPropertyName */; + return node.kind === 154 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11098,164 +11095,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 156 /* TypeParameter */; + return node.kind === 155 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157 /* Parameter */; + return node.kind === 156 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 159 /* PropertySignature */; + return node.kind === 158 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160 /* PropertyDeclaration */; + return node.kind === 159 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161 /* MethodSignature */; + return node.kind === 160 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163 /* Constructor */; + return node.kind === 162 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166 /* CallSignature */; + return node.kind === 165 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167 /* ConstructSignature */; + return node.kind === 166 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168 /* IndexSignature */; + return node.kind === 167 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; + return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 169 /* TypePredicate */; + return node.kind === 168 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170 /* TypeReference */; + return node.kind === 169 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171 /* FunctionType */; + return node.kind === 170 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172 /* ConstructorType */; + return node.kind === 171 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174 /* TypeLiteral */; + return node.kind === 173 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175 /* ArrayType */; + return node.kind === 174 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176 /* TupleType */; + return node.kind === 175 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179 /* UnionType */; + return node.kind === 178 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180 /* IntersectionType */; + return node.kind === 179 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181 /* ConditionalType */; + return node.kind === 180 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182 /* InferType */; + return node.kind === 181 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183 /* ParenthesizedType */; + return node.kind === 182 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184 /* ThisType */; + return node.kind === 183 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185 /* TypeOperator */; + return node.kind === 184 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186 /* IndexedAccessType */; + return node.kind === 185 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187 /* MappedType */; + return node.kind === 186 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188 /* LiteralType */; + return node.kind === 187 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189 /* ImportType */; + return node.kind === 188 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 190 /* ObjectBindingPattern */; + return node.kind === 189 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191 /* ArrayBindingPattern */; + return node.kind === 190 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192 /* BindingElement */; + return node.kind === 191 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 193 /* ArrayLiteralExpression */; + return node.kind === 192 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194 /* ObjectLiteralExpression */; + return node.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11263,7 +11260,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196 /* ElementAccessExpression */; + return node.kind === 195 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11271,7 +11268,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197 /* CallExpression */; + return node.kind === 196 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11281,14 +11278,15 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 195 /* PropertyAccessExpression */ - || kind === 196 /* ElementAccessExpression */ - || kind === 197 /* CallExpression */); + (kind === 194 /* PropertyAccessExpression */ + || kind === 195 /* ElementAccessExpression */ + || kind === 196 /* CallExpression */ + || kind === 218 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; /** @@ -11303,33 +11301,34 @@ var ts; * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`: * * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`) - * 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) - * 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is + * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`) + * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) + * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is * the end of the chain starting at `c?.`) - * 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is + * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is * the end of the chain starting at `a?.`) */ /* @internal */ function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) // cases 1 and 2 - || isOptionalChainRoot(node.parent) // case 3 - || node !== node.parent.expression; // case 4 + return !isOptionalChain(node.parent) // cases 1, 2, and 3 + || isOptionalChainRoot(node.parent) // case 4 + || node !== node.parent.expression; // case 5 } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198 /* NewExpression */; + return node.kind === 197 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199 /* TaggedTemplateExpression */; + return node.kind === 198 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200 /* TypeAssertionExpression */; + return node.kind === 199 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11338,384 +11337,385 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201 /* ParenthesizedExpression */; + return node.kind === 200 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202 /* FunctionExpression */; + return node.kind === 201 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203 /* ArrowFunction */; + return node.kind === 202 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204 /* DeleteExpression */; + return node.kind === 203 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205 /* TypeOfExpression */; + return node.kind === 204 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206 /* VoidExpression */; + return node.kind === 205 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207 /* AwaitExpression */; + return node.kind === 206 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208 /* PrefixUnaryExpression */; + return node.kind === 207 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209 /* PostfixUnaryExpression */; + return node.kind === 208 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210 /* BinaryExpression */; + return node.kind === 209 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211 /* ConditionalExpression */; + return node.kind === 210 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212 /* TemplateExpression */; + return node.kind === 211 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213 /* YieldExpression */; + return node.kind === 212 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214 /* SpreadElement */; + return node.kind === 213 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215 /* ClassExpression */; + return node.kind === 214 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216 /* OmittedExpression */; + return node.kind === 215 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218 /* AsExpression */; + return node.kind === 217 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219 /* NonNullExpression */; + return node.kind === 218 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220 /* MetaProperty */; + return node.kind === 219 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 222 /* TemplateSpan */; + return node.kind === 221 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223 /* SemicolonClassElement */; + return node.kind === 222 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 224 /* Block */; + return node.kind === 223 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226 /* VariableStatement */; + return node.kind === 225 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225 /* EmptyStatement */; + return node.kind === 224 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227 /* ExpressionStatement */; + return node.kind === 226 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228 /* IfStatement */; + return node.kind === 227 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229 /* DoStatement */; + return node.kind === 228 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230 /* WhileStatement */; + return node.kind === 229 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231 /* ForStatement */; + return node.kind === 230 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232 /* ForInStatement */; + return node.kind === 231 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233 /* ForOfStatement */; + return node.kind === 232 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234 /* ContinueStatement */; + return node.kind === 233 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235 /* BreakStatement */; + return node.kind === 234 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; + return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236 /* ReturnStatement */; + return node.kind === 235 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237 /* WithStatement */; + return node.kind === 236 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238 /* SwitchStatement */; + return node.kind === 237 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239 /* LabeledStatement */; + return node.kind === 238 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240 /* ThrowStatement */; + return node.kind === 239 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241 /* TryStatement */; + return node.kind === 240 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242 /* DebuggerStatement */; + return node.kind === 241 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243 /* VariableDeclaration */; + return node.kind === 242 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244 /* VariableDeclarationList */; + return node.kind === 243 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245 /* FunctionDeclaration */; + return node.kind === 244 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246 /* ClassDeclaration */; + return node.kind === 245 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247 /* InterfaceDeclaration */; + return node.kind === 246 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248 /* TypeAliasDeclaration */; + return node.kind === 247 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249 /* EnumDeclaration */; + return node.kind === 248 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */; + return node.kind === 249 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251 /* ModuleBlock */; + return node.kind === 250 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252 /* CaseBlock */; + return node.kind === 251 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253 /* NamespaceExportDeclaration */; + return node.kind === 252 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */; + return node.kind === 253 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255 /* ImportDeclaration */; + return node.kind === 254 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256 /* ImportClause */; + return node.kind === 255 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257 /* NamespaceImport */; + return node.kind === 256 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263 /* NamespaceExport */; + return node.kind === 262 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; + return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258 /* NamedImports */; + return node.kind === 257 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259 /* ImportSpecifier */; + return node.kind === 258 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260 /* ExportAssignment */; + return node.kind === 259 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261 /* ExportDeclaration */; + return node.kind === 260 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262 /* NamedExports */; + return node.kind === 261 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264 /* ExportSpecifier */; + return node.kind === 263 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265 /* MissingDeclaration */; + return node.kind === 264 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 266 /* ExternalModuleReference */; + return node.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 267 /* JsxElement */; + return node.kind === 266 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268 /* JsxSelfClosingElement */; + return node.kind === 267 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269 /* JsxOpeningElement */; + return node.kind === 268 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270 /* JsxClosingElement */; + return node.kind === 269 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271 /* JsxFragment */; + return node.kind === 270 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272 /* JsxOpeningFragment */; + return node.kind === 271 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273 /* JsxClosingFragment */; + return node.kind === 272 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274 /* JsxAttribute */; + return node.kind === 273 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275 /* JsxAttributes */; + return node.kind === 274 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276 /* JsxSpreadAttribute */; + return node.kind === 275 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277 /* JsxExpression */; + return node.kind === 276 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 278 /* CaseClause */; + return node.kind === 277 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279 /* DefaultClause */; + return node.kind === 278 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280 /* HeritageClause */; + return node.kind === 279 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281 /* CatchClause */; + return node.kind === 280 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 282 /* PropertyAssignment */; + return node.kind === 281 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */; + return node.kind === 282 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284 /* SpreadAssignment */; + return node.kind === 283 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 291 /* SourceFile */; + return node.kind === 290 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292 /* Bundle */; + return node.kind === 291 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293 /* UnparsedSource */; + return node.kind === 292 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287 /* UnparsedPrepend */; + return node.kind === 286 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return true; default: return false; @@ -11724,125 +11724,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 /* UnparsedPrologue */ || - node.kind === 290 /* UnparsedSyntheticReference */; + node.kind === 285 /* UnparsedPrologue */ || + node.kind === 289 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 295 /* JSDocTypeExpression */; + return node.kind === 294 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296 /* JSDocAllType */; + return node.kind === 295 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297 /* JSDocUnknownType */; + return node.kind === 296 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298 /* JSDocNullableType */; + return node.kind === 297 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299 /* JSDocNonNullableType */; + return node.kind === 298 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300 /* JSDocOptionalType */; + return node.kind === 299 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301 /* JSDocFunctionType */; + return node.kind === 300 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302 /* JSDocVariadicType */; + return node.kind === 301 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304 /* JSDocComment */; + return node.kind === 303 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310 /* JSDocAuthorTag */; + return node.kind === 309 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308 /* JSDocAugmentsTag */; + return node.kind === 307 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309 /* JSDocImplementsTag */; + return node.kind === 308 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311 /* JSDocClassTag */; + return node.kind === 310 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312 /* JSDocPublicTag */; + return node.kind === 311 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313 /* JSDocPrivateTag */; + return node.kind === 312 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314 /* JSDocProtectedTag */; + return node.kind === 313 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315 /* JSDocReadonlyTag */; + return node.kind === 314 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317 /* JSDocEnumTag */; + return node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320 /* JSDocThisTag */; + return node.kind === 319 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318 /* JSDocParameterTag */; + return node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319 /* JSDocReturnTag */; + return node.kind === 318 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321 /* JSDocTypeTag */; + return node.kind === 320 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322 /* JSDocTemplateTag */; + return node.kind === 321 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323 /* JSDocTypedefTag */; + return node.kind === 322 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324 /* JSDocPropertyTag */; + return node.kind === 323 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; + return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305 /* JSDocTypeLiteral */; + return node.kind === 304 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316 /* JSDocCallbackTag */; + return node.kind === 315 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306 /* JSDocSignature */; + return node.kind === 305 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11853,7 +11853,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 325 /* SyntaxList */; + return n.kind === 324 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11863,7 +11863,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 154 /* FirstNode */; + return kind >= 153 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11872,7 +11872,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11913,12 +11913,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.isTypeOnly; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -11953,13 +11953,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -11982,7 +11982,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 /* QualifiedName */ + return kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; @@ -11992,14 +11992,14 @@ var ts; || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 155 /* ComputedPropertyName */; + || kind === 154 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 190 /* ObjectBindingPattern */ - || kind === 191 /* ArrayBindingPattern */; + || kind === 189 /* ObjectBindingPattern */ + || kind === 190 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12014,13 +12014,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: return false; @@ -12029,14 +12029,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 172 /* ConstructorType */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 171 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12051,29 +12051,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 160 /* PropertyDeclaration */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 168 /* IndexSignature */ - || kind === 223 /* SemicolonClassElement */; + return kind === 162 /* Constructor */ + || kind === 159 /* PropertyDeclaration */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 167 /* IndexSignature */ + || kind === 222 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); + return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); + return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; default: return false; @@ -12083,11 +12083,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 167 /* ConstructSignature */ - || kind === 166 /* CallSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */ - || kind === 168 /* IndexSignature */; + return kind === 166 /* ConstructSignature */ + || kind === 165 /* CallSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */ + || kind === 167 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12096,12 +12096,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 /* PropertyAssignment */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 284 /* SpreadAssignment */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 281 /* PropertyAssignment */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 283 /* SpreadAssignment */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12116,8 +12116,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return true; } return false; @@ -12128,8 +12128,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 /* ArrayBindingPattern */ - || kind === 190 /* ObjectBindingPattern */; + return kind === 190 /* ArrayBindingPattern */ + || kind === 189 /* ObjectBindingPattern */; } return false; } @@ -12137,15 +12137,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 /* ArrayLiteralExpression */ - || kind === 194 /* ObjectLiteralExpression */; + return kind === 192 /* ArrayLiteralExpression */ + || kind === 193 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 /* BindingElement */ - || kind === 216 /* OmittedExpression */; + return kind === 191 /* BindingElement */ + || kind === 215 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12154,9 +12154,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: return true; } return false; @@ -12177,8 +12177,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return true; } return false; @@ -12190,8 +12190,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return true; } return false; @@ -12200,26 +12200,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */ - || kind === 189 /* ImportType */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */ + || kind === 188 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: return true; default: return false; @@ -12227,12 +12227,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; + return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 /* TemplateExpression */ + return kind === 211 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12243,33 +12243,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 198 /* NewExpression */: - case 197 /* CallExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 199 /* TaggedTemplateExpression */: - case 193 /* ArrayLiteralExpression */: - case 201 /* ParenthesizedExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 198 /* TaggedTemplateExpression */: + case 192 /* ArrayLiteralExpression */: + case 200 /* ParenthesizedExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 219 /* NonNullExpression */: - case 220 /* MetaProperty */: + case 218 /* NonNullExpression */: + case 219 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12283,13 +12283,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 200 /* TypeAssertionExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 199 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12298,9 +12298,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12319,15 +12319,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: - case 203 /* ArrowFunction */: - case 210 /* BinaryExpression */: - case 214 /* SpreadElement */: - case 218 /* AsExpression */: - case 216 /* OmittedExpression */: - case 328 /* CommaListExpression */: - case 327 /* PartiallyEmittedExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: + case 202 /* ArrowFunction */: + case 209 /* BinaryExpression */: + case 213 /* SpreadElement */: + case 217 /* AsExpression */: + case 215 /* OmittedExpression */: + case 327 /* CommaListExpression */: + case 326 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12335,23 +12335,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 /* TypeAssertionExpression */ - || kind === 218 /* AsExpression */; + return kind === 199 /* TypeAssertionExpression */ + || kind === 217 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 327 /* PartiallyEmittedExpression */; + return node.kind === 326 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 326 /* NotEmittedStatement */; + return node.kind === 325 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 331 /* SyntheticReferenceExpression */; + return node.kind === 330 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12362,13 +12362,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12397,7 +12397,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; + return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12421,114 +12421,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */ + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */; + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 250 /* ModuleDeclaration */; + || kind === 249 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 /* NamedImports */ - || kind === 257 /* NamespaceImport */; + return kind === 257 /* NamedImports */ + || kind === 256 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; + return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 /* ArrowFunction */ - || kind === 192 /* BindingElement */ - || kind === 246 /* ClassDeclaration */ - || kind === 215 /* ClassExpression */ - || kind === 163 /* Constructor */ - || kind === 249 /* EnumDeclaration */ - || kind === 285 /* EnumMember */ - || kind === 264 /* ExportSpecifier */ - || kind === 245 /* FunctionDeclaration */ - || kind === 202 /* FunctionExpression */ - || kind === 164 /* GetAccessor */ - || kind === 256 /* ImportClause */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 259 /* ImportSpecifier */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 274 /* JsxAttribute */ - || kind === 162 /* MethodDeclaration */ - || kind === 161 /* MethodSignature */ - || kind === 250 /* ModuleDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 257 /* NamespaceImport */ - || kind === 263 /* NamespaceExport */ - || kind === 157 /* Parameter */ - || kind === 282 /* PropertyAssignment */ - || kind === 160 /* PropertyDeclaration */ - || kind === 159 /* PropertySignature */ - || kind === 165 /* SetAccessor */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 156 /* TypeParameter */ - || kind === 243 /* VariableDeclaration */ - || kind === 323 /* JSDocTypedefTag */ - || kind === 316 /* JSDocCallbackTag */ - || kind === 324 /* JSDocPropertyTag */; + return kind === 202 /* ArrowFunction */ + || kind === 191 /* BindingElement */ + || kind === 245 /* ClassDeclaration */ + || kind === 214 /* ClassExpression */ + || kind === 162 /* Constructor */ + || kind === 248 /* EnumDeclaration */ + || kind === 284 /* EnumMember */ + || kind === 263 /* ExportSpecifier */ + || kind === 244 /* FunctionDeclaration */ + || kind === 201 /* FunctionExpression */ + || kind === 163 /* GetAccessor */ + || kind === 255 /* ImportClause */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportSpecifier */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 273 /* JsxAttribute */ + || kind === 161 /* MethodDeclaration */ + || kind === 160 /* MethodSignature */ + || kind === 249 /* ModuleDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 256 /* NamespaceImport */ + || kind === 262 /* NamespaceExport */ + || kind === 156 /* Parameter */ + || kind === 281 /* PropertyAssignment */ + || kind === 159 /* PropertyDeclaration */ + || kind === 158 /* PropertySignature */ + || kind === 164 /* SetAccessor */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 155 /* TypeParameter */ + || kind === 242 /* VariableDeclaration */ + || kind === 322 /* JSDocTypedefTag */ + || kind === 315 /* JSDocCallbackTag */ + || kind === 323 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 265 /* MissingDeclaration */ - || kind === 246 /* ClassDeclaration */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 249 /* EnumDeclaration */ - || kind === 250 /* ModuleDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 260 /* ExportAssignment */ - || kind === 253 /* NamespaceExportDeclaration */; + return kind === 244 /* FunctionDeclaration */ + || kind === 264 /* MissingDeclaration */ + || kind === 245 /* ClassDeclaration */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 248 /* EnumDeclaration */ + || kind === 249 /* ModuleDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 259 /* ExportAssignment */ + || kind === 252 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 /* BreakStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 229 /* DoStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 225 /* EmptyStatement */ - || kind === 232 /* ForInStatement */ - || kind === 233 /* ForOfStatement */ - || kind === 231 /* ForStatement */ - || kind === 228 /* IfStatement */ - || kind === 239 /* LabeledStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 238 /* SwitchStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 241 /* TryStatement */ - || kind === 226 /* VariableStatement */ - || kind === 230 /* WhileStatement */ - || kind === 237 /* WithStatement */ - || kind === 326 /* NotEmittedStatement */ - || kind === 330 /* EndOfDeclarationMarker */ - || kind === 329 /* MergeDeclarationMarker */; + return kind === 234 /* BreakStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 228 /* DoStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 224 /* EmptyStatement */ + || kind === 231 /* ForInStatement */ + || kind === 232 /* ForOfStatement */ + || kind === 230 /* ForStatement */ + || kind === 227 /* IfStatement */ + || kind === 238 /* LabeledStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 237 /* SwitchStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 240 /* TryStatement */ + || kind === 225 /* VariableStatement */ + || kind === 229 /* WhileStatement */ + || kind === 236 /* WithStatement */ + || kind === 325 /* NotEmittedStatement */ + || kind === 329 /* EndOfDeclarationMarker */ + || kind === 328 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 156 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 155 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12555,10 +12555,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224 /* Block */) + if (node.kind !== 223 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { + if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { return false; } } @@ -12568,8 +12568,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 266 /* ExternalModuleReference */ - || kind === 154 /* QualifiedName */ + return kind === 265 /* ExternalModuleReference */ + || kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12579,70 +12579,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 195 /* PropertyAccessExpression */; + || kind === 194 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 267 /* JsxElement */ - || kind === 277 /* JsxExpression */ - || kind === 268 /* JsxSelfClosingElement */ + return kind === 266 /* JsxElement */ + || kind === 276 /* JsxExpression */ + || kind === 267 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 271 /* JsxFragment */; + || kind === 270 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 /* JsxAttribute */ - || kind === 276 /* JsxSpreadAttribute */; + return kind === 273 /* JsxAttribute */ + || kind === 275 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 277 /* JsxExpression */; + || kind === 276 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 /* JsxOpeningElement */ - || kind === 268 /* JsxSelfClosingElement */; + return kind === 268 /* JsxOpeningElement */ + || kind === 267 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 /* CaseClause */ - || kind === 279 /* DefaultClause */; + return kind === 277 /* CaseClause */ + || kind === 278 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; + return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; + return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12668,13 +12668,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: return true; default: return false; @@ -12682,12 +12682,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -12982,7 +12982,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291 /* SourceFile */) { + while (node && node.kind !== 290 /* SourceFile */) { node = node.parent; } return node; @@ -12990,11 +12990,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return true; } return false; @@ -13189,7 +13189,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13314,7 +13314,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; + return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13346,11 +13346,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 && node.kind === 250 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 /* SourceFile */ || - node.kind === 250 /* ModuleDeclaration */ || + return node.kind === 290 /* SourceFile */ || + node.kind === 249 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13367,9 +13367,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node.parent); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13422,22 +13422,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 281 /* CatchClause */: - case 250 /* ModuleDeclaration */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 280 /* CatchClause */: + case 249 /* ModuleDeclaration */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 224 /* Block */: + case 223 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13447,9 +13447,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 306 /* JSDocSignature */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 305 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13459,25 +13459,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13487,8 +13487,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13497,15 +13497,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 226 /* VariableStatement */: - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 225 /* VariableStatement */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return true; default: return false; @@ -13542,7 +13542,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13558,9 +13558,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13621,7 +13621,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224 /* Block */) { + if (node.body && node.body.kind === 223 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13635,7 +13635,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13644,28 +13644,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: errorNode = node.name; break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13717,11 +13717,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13735,7 +13735,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 /* ExpressionStatement */ + return node.kind === 226 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13744,11 +13744,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 /* Parameter */ || - node.kind === 156 /* TypeParameter */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 203 /* ArrowFunction */ || - node.kind === 201 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 156 /* Parameter */ || + node.kind === 155 /* TypeParameter */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 202 /* ArrowFunction */ || + node.kind === 200 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13764,48 +13764,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 206 /* VoidExpression */; - case 217 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 205 /* VoidExpression */; + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156 /* TypeParameter */: - return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; + case 155 /* TypeParameter */: + return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 194 /* 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 === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 154 /* QualifiedName */: - case 195 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 173 /* TypeQuery */) { + if (parent.kind === 172 /* TypeQuery */) { return false; } - if (parent.kind === 189 /* ImportType */) { + if (parent.kind === 188 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13814,40 +13814,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return node === parent.constraint; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return node === parent.constraint; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return node === parent.type; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node === parent.type; - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return node === parent.type; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return node === parent.type; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13872,23 +13872,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitor(node); - case 252 /* CaseBlock */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 251 /* CaseBlock */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13898,23 +13898,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* 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(node.name.expression); @@ -13937,10 +13937,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 175 /* ArrayType */) { + if (node && node.kind === 174 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 170 /* TypeReference */) { + else if (node && node.kind === 169 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13950,12 +13950,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 174 /* TypeLiteral */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 173 /* TypeLiteral */: return node.members; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return node.properties; } } @@ -13963,14 +13963,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192 /* BindingElement */: - case 285 /* EnumMember */: - case 157 /* Parameter */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 284 /* EnumMember */: + case 156 /* Parameter */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 242 /* VariableDeclaration */: return true; } } @@ -13982,8 +13982,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ - && node.parent.parent.kind === 226 /* VariableStatement */; + return node.parent.kind === 243 /* VariableDeclarationList */ + && node.parent.parent.kind === 225 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -13994,13 +13994,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return true; } return false; @@ -14011,7 +14011,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239 /* LabeledStatement */) { + if (node.statement.kind !== 238 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14019,17 +14019,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; + return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 /* MethodDeclaration */ && - (node.parent.kind === 194 /* ObjectLiteralExpression */ || - node.parent.kind === 215 /* ClassExpression */); + return node.kind === 161 /* MethodDeclaration */ && + (node.parent.kind === 193 /* ObjectLiteralExpression */ || + node.parent.kind === 214 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14042,7 +14042,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282 /* PropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14083,14 +14083,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291 /* SourceFile */); + ts.Debug.assert(node.kind !== 290 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* 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 @@ -14105,9 +14105,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14118,26 +14118,26 @@ var ts; node = node.parent; } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 250 /* ModuleDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 249 /* EnumDeclaration */: - case 291 /* SourceFile */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 249 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 248 /* EnumDeclaration */: + case 290 /* SourceFile */: return node; } } @@ -14147,9 +14147,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return container; } } @@ -14171,27 +14171,27 @@ var ts; return node; } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: node = node.parent; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14207,14 +14207,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { + if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 201 /* ParenthesizedExpression */) { + while (parent.kind === 200 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14230,7 +14230,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14239,20 +14239,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return node; } return undefined; @@ -14260,10 +14260,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return node.tag; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14276,25 +14276,25 @@ var ts; return false; } switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // classes are valid targets return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 246 /* ClassDeclaration */; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + return parent.kind === 245 /* ClassDeclaration */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 246 /* ClassDeclaration */; - case 157 /* Parameter */: + && parent.kind === 245 /* ClassDeclaration */; + case 156 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 163 /* Constructor */ - || parent.kind === 162 /* MethodDeclaration */ - || parent.kind === 165 /* SetAccessor */) - && grandparent.kind === 246 /* ClassDeclaration */; + && (parent.kind === 162 /* Constructor */ + || parent.kind === 161 /* MethodDeclaration */ + || parent.kind === 164 /* SetAccessor */) + && grandparent.kind === 245 /* ClassDeclaration */; } return false; } @@ -14310,10 +14310,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14322,9 +14322,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 /* JsxOpeningElement */ || - parent.kind === 268 /* JsxSelfClosingElement */ || - parent.kind === 270 /* JsxClosingElement */) { + if (parent.kind === 268 /* JsxOpeningElement */ || + parent.kind === 267 /* JsxSelfClosingElement */ || + parent.kind === 269 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14337,44 +14337,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 218 /* AsExpression */: - case 200 /* TypeAssertionExpression */: - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 210 /* BinaryExpression */: - case 211 /* ConditionalExpression */: - case 214 /* SpreadElement */: - case 212 /* TemplateExpression */: - case 216 /* OmittedExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 213 /* YieldExpression */: - case 207 /* AwaitExpression */: - case 220 /* MetaProperty */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 217 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 209 /* BinaryExpression */: + case 210 /* ConditionalExpression */: + case 213 /* SpreadElement */: + case 211 /* TemplateExpression */: + case 215 /* OmittedExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 212 /* YieldExpression */: + case 206 /* AwaitExpression */: + case 219 /* MetaProperty */: return true; - case 154 /* QualifiedName */: - while (node.parent.kind === 154 /* QualifiedName */) { + case 153 /* QualifiedName */: + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14392,49 +14392,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 191 /* BindingElement */: return parent.initializer === node; - case 227 /* ExpressionStatement */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 236 /* ReturnStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 240 /* ThrowStatement */: + case 226 /* ExpressionStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 235 /* ReturnStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 239 /* ThrowStatement */: return parent.expression === node; - case 231 /* ForStatement */: + case 230 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forInStatement.expression === node; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return node === parent.expression; - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return node === parent.expression; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return node === parent.expression; - case 158 /* Decorator */: - case 277 /* JsxExpression */: - case 276 /* JsxSpreadAttribute */: - case 284 /* SpreadAssignment */: + case 157 /* Decorator */: + case 276 /* JsxExpression */: + case 275 /* JsxSpreadAttribute */: + case 283 /* SpreadAssignment */: return true; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14442,14 +14442,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14458,7 +14458,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14490,11 +14490,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); + (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197 /* CallExpression */) { + if (callExpression.kind !== 196 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14626,11 +14626,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 202 /* FunctionExpression */ || - initializer.kind === 215 /* ClassExpression */ || - initializer.kind === 203 /* ArrowFunction */) { + if (initializer.kind === 201 /* FunctionExpression */ || + initializer.kind === 214 /* ClassExpression */ || + initializer.kind === 202 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14877,7 +14877,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14887,7 +14887,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14896,14 +14896,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.parent; - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return node.parent.parent; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 188 /* LiteralType */: + case 187 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14913,12 +14913,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.moduleSpecifier; - case 254 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 189 /* ImportType */: + case 253 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 188 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14927,11 +14927,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14939,7 +14939,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14960,13 +14960,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157 /* Parameter */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 283 /* ShorthandPropertyAssignment */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 282 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14980,7 +14980,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; + return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15005,12 +15005,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return node.initializer; } } @@ -15021,7 +15021,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 /* ModuleDeclaration */ + node.body.kind === 249 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15036,11 +15036,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156 /* TypeParameter */) { + if (node.kind === 155 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15051,10 +15051,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 /* PropertyAssignment */ || - parent.kind === 260 /* ExportAssignment */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || + if (parent.kind === 281 /* PropertyAssignment */ || + parent.kind === 259 /* ExportAssignment */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15128,7 +15128,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15145,31 +15145,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 201 /* ParenthesizedExpression */: - case 193 /* ArrayLiteralExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 192 /* ArrayLiteralExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: node = parent; break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15196,22 +15196,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224 /* Block */: - case 226 /* VariableStatement */: - case 237 /* WithStatement */: - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 223 /* Block */: + case 225 /* VariableStatement */: + case 236 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return true; } return false; @@ -15228,33 +15228,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183 /* ParenthesizedType */); + return walkUp(node, 182 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201 /* ParenthesizedExpression */); + return walkUp(node, 200 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { + while (node.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { + if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204 /* DeleteExpression */; + return node && node.kind === 203 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15307,7 +15304,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 /* ComputedPropertyName */ && + node.parent.kind === 154 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15315,32 +15312,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 195 /* PropertyAccessExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 194 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 154 /* QualifiedName */) { + while (parent.kind === 153 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; + return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; } return false; - case 192 /* BindingElement */: - case 259 /* ImportSpecifier */: + case 191 /* BindingElement */: + case 258 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 264 /* ExportSpecifier */: - case 274 /* JsxAttribute */: + case 263 /* ExportSpecifier */: + case 273 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15360,33 +15357,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 257 /* NamespaceImport */: - case 264 /* ExportSpecifier */: - case 260 /* ExportAssignment */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 256 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 259 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: return node.parent; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 154 /* QualifiedName */); + } while (node.parent.kind === 153 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15405,7 +15402,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : + return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15471,11 +15468,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15519,14 +15516,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15540,10 +15537,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15576,7 +15573,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { + if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15602,7 +15599,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15665,11 +15662,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157 /* Parameter */; + return root.kind === 156 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192 /* BindingElement */) { + while (node.kind === 191 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15677,15 +15674,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 202 /* FunctionExpression */ - || kind === 245 /* FunctionDeclaration */ - || kind === 203 /* ArrowFunction */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 250 /* ModuleDeclaration */ - || kind === 291 /* SourceFile */; + return kind === 162 /* Constructor */ + || kind === 201 /* FunctionExpression */ + || kind === 244 /* FunctionDeclaration */ + || kind === 202 /* ArrowFunction */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 249 /* ModuleDeclaration */ + || kind === 290 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15704,23 +15701,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: return 1 /* Right */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15744,15 +15741,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210 /* BinaryExpression */) { + if (expression.kind === 209 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { + else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15762,15 +15759,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return 0; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return 1; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return 2; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return 4; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15791,21 +15788,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: return 16; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return 17; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return 18; - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 19 : 18; - case 199 /* TaggedTemplateExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 198 /* TaggedTemplateExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15816,19 +15813,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 201 /* ParenthesizedExpression */: - case 216 /* OmittedExpression */: + case 211 /* TemplateExpression */: + case 200 /* ParenthesizedExpression */: + case 215 /* OmittedExpression */: return 20; default: return -1; @@ -16439,10 +16436,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 165 /* SetAccessor */) { + else if (accessor.kind === 164 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16462,10 +16459,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 /* GetAccessor */ && !getAccessor) { + if (member.kind === 163 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 165 /* SetAccessor */ && !setAccessor) { + if (member.kind === 164 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16514,7 +16511,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16738,7 +16735,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16780,11 +16777,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 131 /* DeclareKeyword */: return 2 /* Ambient */; + case 130 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16824,8 +16821,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 194 /* ObjectLiteralExpression */ - || kind === 193 /* ArrayLiteralExpression */; + return kind === 193 /* ObjectLiteralExpression */ + || kind === 192 /* ArrayLiteralExpression */; } return false; } @@ -16842,12 +16839,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16857,8 +16854,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -16888,17 +16885,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 /* ObjectLiteralExpression */ && + return expression.kind === 193 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 /* ArrayLiteralExpression */ && + return expression.kind === 192 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17222,8 +17219,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17300,35 +17297,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return accessKind(parent); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 282 /* PropertyAssignment */: { + case 281 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17477,39 +17474,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) + return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 149 /* UnknownKeyword */ - || kind === 141 /* NumberKeyword */ - || kind === 152 /* BigIntKeyword */ - || kind === 142 /* ObjectKeyword */ - || kind === 129 /* BooleanKeyword */ - || kind === 144 /* StringKeyword */ - || kind === 145 /* SymbolKeyword */ + || kind === 148 /* UnknownKeyword */ + || kind === 140 /* NumberKeyword */ + || kind === 151 /* BigIntKeyword */ + || kind === 141 /* ObjectKeyword */ + || kind === 128 /* BooleanKeyword */ + || kind === 143 /* StringKeyword */ + || kind === 144 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 147 /* UndefinedKeyword */ + || kind === 146 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 138 /* NeverKeyword */ - || kind === 217 /* ExpressionWithTypeArguments */ - || kind === 296 /* JSDocAllType */ - || kind === 297 /* JSDocUnknownType */ - || kind === 298 /* JSDocNullableType */ - || kind === 299 /* JSDocNonNullableType */ - || kind === 300 /* JSDocOptionalType */ - || kind === 301 /* JSDocFunctionType */ - || kind === 302 /* JSDocVariadicType */; + || kind === 137 /* NeverKeyword */ + || kind === 216 /* ExpressionWithTypeArguments */ + || kind === 295 /* JSDocAllType */ + || kind === 296 /* JSDocUnknownType */ + || kind === 297 /* JSDocNullableType */ + || kind === 298 /* JSDocNonNullableType */ + || kind === 299 /* JSDocOptionalType */ + || kind === 300 /* JSDocFunctionType */ + || kind === 301 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195 /* PropertyAccessExpression */) { + if (node.kind === 194 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17524,7 +17521,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; + return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18608,21 +18605,21 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; + return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { @@ -18630,16 +18627,16 @@ var ts; return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return true; - case 195 /* PropertyAccessExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 194 /* PropertyAccessExpression */: + case 216 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18659,7 +18656,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291 /* SourceFile */) { + if (kind === 290 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18714,19 +18711,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153 /* LastToken */) { + if (!node || node.kind <= 152 /* LastToken */) { return; } switch (node.kind) { - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18734,9 +18731,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18744,7 +18741,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18752,51 +18749,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18808,359 +18805,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 176 /* TupleType */: + case 175 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182 /* InferType */: + case 181 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 189 /* ImportType */: + case 188 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183 /* ParenthesizedType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 184 /* TypeOperator */: return visitNode(cbNode, node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187 /* MappedType */: + case 186 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return visitNode(cbNode, node.literal); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitNode(cbNode, node.name); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return visitNode(cbNode, node.label); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158 /* Decorator */: + case 157 /* Decorator */: return visitNode(cbNode, node.expression); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 177 /* OptionalType */: - case 178 /* RestType */: - case 295 /* JSDocTypeExpression */: - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 300 /* JSDocOptionalType */: - case 302 /* JSDocVariadicType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 294 /* JSDocTypeExpression */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 299 /* JSDocOptionalType */: + case 301 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310 /* JSDocAuthorTag */: + case 309 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 /* JSDocTypeExpression */ + node.typeExpression.kind === 294 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307 /* JSDocTag */: - case 311 /* JSDocClassTag */: - case 312 /* JSDocPublicTag */: - case 313 /* JSDocPrivateTag */: - case 314 /* JSDocProtectedTag */: - case 315 /* JSDocReadonlyTag */: + case 306 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 311 /* JSDocPublicTag */: + case 312 /* JSDocPrivateTag */: + case 313 /* JSDocProtectedTag */: + case 314 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19449,7 +19446,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227 /* ExpressionStatement */); + var statement = createNode(226 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19601,7 +19598,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19933,7 +19930,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 226 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20045,7 +20042,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(155 /* ComputedPropertyName */); + var node = createNode(154 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20087,15 +20084,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146 /* TypeKeyword */) { + if (token() === 145 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20505,20 +20502,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163 /* Constructor */: - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 223 /* SemicolonClassElement */: + case 162 /* Constructor */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 222 /* SemicolonClassElement */: return true; - case 162 /* MethodDeclaration */: + case 161 /* 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 === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20527,8 +20524,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return true; } } @@ -20537,58 +20534,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 226 /* VariableStatement */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 227 /* ExpressionStatement */: - case 240 /* ThrowStatement */: - case 236 /* ReturnStatement */: - case 238 /* SwitchStatement */: - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 225 /* EmptyStatement */: - case 241 /* TryStatement */: - case 239 /* LabeledStatement */: - case 229 /* DoStatement */: - case 242 /* DebuggerStatement */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 225 /* VariableStatement */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 226 /* ExpressionStatement */: + case 239 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 237 /* SwitchStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 224 /* EmptyStatement */: + case 240 /* TryStatement */: + case 238 /* LabeledStatement */: + case 228 /* DoStatement */: + case 241 /* DebuggerStatement */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 159 /* PropertySignature */: - case 166 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 158 /* PropertySignature */: + case 165 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243 /* VariableDeclaration */) { + if (node.kind !== 242 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20609,7 +20606,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157 /* Parameter */) { + if (node.kind !== 156 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20748,7 +20745,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154 /* QualifiedName */, entity.pos); + var node = createNode(153 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20789,7 +20786,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212 /* TemplateExpression */); + var template = createNode(211 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20801,7 +20798,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222 /* TemplateSpan */); + var span = createNode(221 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20867,7 +20864,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20877,14 +20874,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: { + case 170 /* FunctionType */: + case 171 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20892,20 +20889,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169 /* TypePredicate */, lhs.pos); + var node = createNode(168 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184 /* ThisType */); + var node = createNode(183 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296 /* JSDocAllType */); + var result = createNode(295 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(300 /* JSDocOptionalType */, result); + return createPostfixType(299 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20913,7 +20910,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299 /* JSDocNonNullableType */); + var result = createNode(298 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20937,28 +20934,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(297 /* JSDocUnknownType */, pos); + var result = createNode(296 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(298 /* JSDocNullableType */, pos); + var result = createNode(297 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157 /* Parameter */); + var parameter = createNode(156 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20968,9 +20965,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20989,23 +20986,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(300 /* JSDocOptionalType */, type); + return createPostfixType(299 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(173 /* TypeQuery */); + var node = createNode(172 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21050,7 +21047,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157 /* Parameter */); + var node = createNodeWithJSDoc(156 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21151,7 +21148,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167 /* ConstructSignature */) { + if (kind === 166 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21212,7 +21209,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 168 /* IndexSignature */; + node.kind = 167 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21222,13 +21219,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 161 /* MethodSignature */; + node.kind = 160 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 159 /* PropertySignature */; + node.kind = 158 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21274,10 +21271,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(166 /* CallSignature */); + return parseSignatureMember(165 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167 /* ConstructSignature */); + return parseSignatureMember(166 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21303,7 +21300,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174 /* TypeLiteral */); + var node = createNode(173 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21321,27 +21318,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 139 /* ReadonlyKeyword */; + return nextToken() === 138 /* ReadonlyKeyword */; } - if (token() === 139 /* ReadonlyKeyword */) { + if (token() === 138 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187 /* MappedType */); + var node = createNode(186 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { - parseExpectedToken(139 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + parseExpectedToken(138 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21361,23 +21358,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(178 /* RestType */, pos); + var node = createNode(177 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 177 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 176 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(176 /* TupleType */); + var node = createNode(175 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183 /* ParenthesizedType */); + var node = createNode(182 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21385,7 +21382,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21395,10 +21392,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188 /* LiteralType */); + var node = createNode(187 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21419,7 +21416,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(189 /* ImportType */); + var node = createNode(188 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21442,15 +21439,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 145 /* SymbolKeyword */: - case 129 /* BooleanKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 144 /* SymbolKeyword */: + case 128 /* BooleanKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21481,7 +21478,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21507,20 +21504,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 139 /* ReadonlyKeyword */: - case 145 /* SymbolKeyword */: - case 148 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 138 /* ReadonlyKeyword */: + case 144 /* SymbolKeyword */: + case 147 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21532,12 +21529,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21562,26 +21559,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(299 /* JSDocNonNullableType */, type); + type = createPostfixType(298 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298 /* JSDocNullableType */, type); + type = createPostfixType(297 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(186 /* IndexedAccessType */, type.pos); + var node = createNode(185 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(175 /* ArrayType */, type.pos); + var node = createNode(174 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21600,16 +21597,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185 /* TypeOperator */); + var node = createNode(184 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182 /* InferType */); - parseExpected(133 /* InferKeyword */); - var typeParameter = createNode(156 /* TypeParameter */); + var node = createNode(181 /* InferType */); + parseExpected(132 /* InferKeyword */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21617,12 +21614,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135 /* KeyOfKeyword */: - case 148 /* UniqueKeyword */: - case 139 /* ReadonlyKeyword */: - case 128 /* AwaitedKeyword */: + case 134 /* KeyOfKeyword */: + case 147 /* UniqueKeyword */: + case 138 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21643,10 +21639,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21703,7 +21699,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21715,16 +21711,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169 /* TypePredicate */); + var node = createNode(168 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21738,7 +21734,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(181 /* ConditionalType */, type.pos); + var node = createNode(180 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21933,7 +21929,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213 /* YieldExpression */); + var node = createNode(212 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21955,13 +21951,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203 /* ArrowFunction */, asyncModifier.pos); + node = createNode(202 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203 /* ArrowFunction */, identifier.pos); + node = createNode(202 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(157 /* Parameter */, identifier.pos); + var parameter = createNode(156 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22166,7 +22162,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203 /* ArrowFunction */); + var node = createNodeWithJSDoc(202 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22232,7 +22228,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22247,7 +22243,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22312,39 +22308,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210 /* BinaryExpression */, left.pos); + var node = createNode(209 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218 /* AsExpression */, left.pos); + var node = createNode(217 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204 /* DeleteExpression */); + var node = createNode(203 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205 /* TypeOfExpression */); + var node = createNode(204 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206 /* VoidExpression */); + var node = createNode(205 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22360,7 +22356,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207 /* AwaitExpression */); + var node = createNode(206 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22404,7 +22400,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { parseErrorAt(pos, end, 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 { @@ -22501,7 +22497,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22514,7 +22510,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22570,7 +22566,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(220 /* MetaProperty */, fullStart); + var node = createNode(219 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22653,7 +22649,7 @@ var ts; } // 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(195 /* PropertyAccessExpression */, expression.pos); + var node = createNode(194 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22663,8 +22659,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269 /* JsxOpeningElement */) { - var node = createNode(267 /* JsxElement */, opening.pos); + if (opening.kind === 268 /* JsxOpeningElement */) { + var node = createNode(266 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22673,15 +22669,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272 /* JsxOpeningFragment */) { - var node = createNode(271 /* JsxFragment */, opening.pos); + else if (opening.kind === 271 /* JsxOpeningFragment */) { + var node = createNode(270 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22696,7 +22692,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210 /* BinaryExpression */, result.pos); + var badNode = createNode(209 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22759,7 +22755,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275 /* JsxAttributes */); + var jsxAttributes = createNode(274 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22768,7 +22764,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22780,7 +22776,7 @@ var ts; // 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(269 /* JsxOpeningElement */, fullStart); + node = createNode(268 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22792,7 +22788,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(268 /* JsxSelfClosingElement */, fullStart); + node = createNode(267 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22809,7 +22805,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22817,7 +22813,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277 /* JsxExpression */); + var node = createNode(276 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22843,7 +22839,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274 /* JsxAttribute */); + var node = createNode(273 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22858,7 +22854,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276 /* JsxSpreadAttribute */); + var node = createNode(275 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22866,7 +22862,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270 /* JsxClosingElement */); + var node = createNode(269 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22879,7 +22875,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273 /* JsxClosingFragment */); + var node = createNode(272 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22894,7 +22890,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200 /* TypeAssertionExpression */); + var node = createNode(199 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22911,12 +22907,33 @@ var ts; return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32 /* OptionalChain */) { + return true; + } + // check for an optional chain in a non-null expression + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + expr = expr.expression; + } + if (expr.flags & 32 /* OptionalChain */) { + // this is part of an optional chain. Walk down from `node` to `expression` and set the flag. + while (ts.isNonNullExpression(node)) { + node.flags |= 32 /* OptionalChain */; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32 /* OptionalChain */; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -22925,7 +22942,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22939,7 +22956,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32 /* OptionalChain */; } return finishNode(indexedAccess); @@ -22961,7 +22978,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22982,7 +22999,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -23010,12 +23027,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23023,11 +23040,11 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23035,7 +23052,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23154,28 +23171,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214 /* SpreadElement */); + var node = createNode(213 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193 /* ArrayLiteralExpression */); + var node = createNode(192 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23187,17 +23204,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 284 /* SpreadAssignment */; + node.kind = 283 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23215,7 +23232,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 283 /* ShorthandPropertyAssignment */; + node.kind = 282 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23223,14 +23240,14 @@ var ts; } } else { - node.kind = 282 /* PropertyAssignment */; + node.kind = 281 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194 /* ObjectLiteralExpression */); + var node = createNode(193 /* ObjectLiteralExpression */); var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { @@ -23255,7 +23272,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(202 /* FunctionExpression */); + var node = createNodeWithJSDoc(201 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23280,7 +23297,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(220 /* MetaProperty */, fullStart); + var node_2 = createNode(219 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23297,7 +23314,7 @@ var ts; } break; } - var node = createNode(198 /* NewExpression */, fullStart); + var node = createNode(197 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23307,7 +23324,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224 /* Block */); + var node = createNode(223 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23346,12 +23363,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225 /* EmptyStatement */); + var node = createNode(224 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(228 /* IfStatement */); + var node = createNode(227 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23361,7 +23378,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229 /* DoStatement */); + var node = createNode(228 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23376,7 +23393,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230 /* WhileStatement */); + var node = createNode(229 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23399,8 +23416,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { - var forOfStatement = createNode(233 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { + var forOfStatement = createNode(232 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23408,14 +23425,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(232 /* ForInStatement */, pos); + var forInStatement = createNode(231 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231 /* ForStatement */, pos); + var forStatement = createNode(230 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23433,7 +23450,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23441,7 +23458,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236 /* ReturnStatement */); + var node = createNode(235 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23450,7 +23467,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237 /* WithStatement */); + var node = createNode(236 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23459,7 +23476,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278 /* CaseClause */); + var node = createNode(277 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23467,7 +23484,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279 /* DefaultClause */); + var node = createNode(278 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23477,12 +23494,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238 /* SwitchStatement */); + var node = createNode(237 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(252 /* CaseBlock */); + var caseBlock = createNode(251 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23497,7 +23514,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(240 /* ThrowStatement */); + var node = createNode(239 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23505,7 +23522,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(241 /* TryStatement */); + var node = createNode(240 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23518,7 +23535,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281 /* CatchClause */); + var result = createNode(280 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23532,7 +23549,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242 /* DebuggerStatement */); + var node = createNode(241 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23541,15 +23558,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 226 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 239 /* LabeledStatement */; + node.kind = 238 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227 /* ExpressionStatement */; + node.kind = 226 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23603,25 +23620,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23630,7 +23647,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 146 /* TypeKeyword */) { + if (currentToken_1 === 145 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23684,19 +23701,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 146 /* TypeKeyword */: - case 151 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 145 /* TypeKeyword */: + case 150 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23720,16 +23737,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23739,9 +23756,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(234 /* ContinueStatement */); + return parseBreakOrContinueStatement(233 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(235 /* BreakStatement */); + return parseBreakOrContinueStatement(234 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23762,10 +23779,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 131 /* DeclareKeyword */: + case 145 /* TypeKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23775,8 +23792,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: - case 151 /* GlobalKeyword */: + case 138 /* ReadonlyKeyword */: + case 150 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23785,7 +23802,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131 /* DeclareKeyword */; + return modifier.kind === 130 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23833,13 +23850,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 151 /* GlobalKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 150 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23858,7 +23875,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23881,16 +23898,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(216 /* OmittedExpression */); + return createNode(215 /* OmittedExpression */); } - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23906,14 +23923,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190 /* ObjectBindingPattern */); + var node = createNode(189 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191 /* ArrayBindingPattern */); + var node = createNode(190 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23938,7 +23955,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243 /* VariableDeclaration */); + var node = createNode(242 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23951,7 +23968,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244 /* VariableDeclarationList */); + var node = createNode(243 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23974,7 +23991,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23989,13 +24006,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 226 /* VariableStatement */; + node.kind = 225 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245 /* FunctionDeclaration */; + node.kind = 244 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -24006,8 +24023,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130 /* ConstructorKeyword */) { - return parseExpected(130 /* ConstructorKeyword */); + if (token() === 129 /* ConstructorKeyword */) { + return parseExpected(129 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -24019,7 +24036,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163 /* Constructor */; + node.kind = 162 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -24027,7 +24044,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162 /* MethodDeclaration */; + node.kind = 161 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -24036,7 +24053,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160 /* PropertyDeclaration */; + node.kind = 159 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24098,7 +24115,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24130,7 +24147,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(158 /* Decorator */, decoratorStart); + var decorator = createNode(157 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24180,20 +24197,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(223 /* SemicolonClassElement */); + var result = createNode(222 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } - if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24230,10 +24247,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24276,14 +24293,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(280 /* HeritageClause */); + var node = createNode(279 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24299,7 +24316,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247 /* InterfaceDeclaration */; + node.kind = 246 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24308,8 +24325,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248 /* TypeAliasDeclaration */; - parseExpected(146 /* TypeKeyword */); + node.kind = 247 /* TypeAliasDeclaration */; + parseExpected(145 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24322,13 +24339,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(285 /* EnumMember */); + var node = createNodeWithJSDoc(284 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249 /* EnumDeclaration */; + node.kind = 248 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24341,7 +24358,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251 /* ModuleBlock */); + var node = createNode(250 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24352,7 +24369,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250 /* ModuleDeclaration */; + node.kind = 249 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24364,8 +24381,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250 /* ModuleDeclaration */; - if (token() === 151 /* GlobalKeyword */) { + node.kind = 249 /* ModuleDeclaration */; + if (token() === 150 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24384,15 +24401,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151 /* GlobalKeyword */) { + if (token() === 150 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137 /* NamespaceKeyword */)) { + else if (parseOptional(136 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(136 /* ModuleKeyword */); + parseExpected(135 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24400,7 +24417,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 /* RequireKeyword */ && + return token() === 139 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24410,9 +24427,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 253 /* NamespaceExportDeclaration */; + node.kind = 252 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(137 /* NamespaceKeyword */); + parseExpected(136 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24425,7 +24442,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 /* FromKeyword */ && + if (token() !== 149 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24435,7 +24452,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 255 /* ImportDeclaration */; + node.kind = 254 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24444,7 +24461,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24456,10 +24473,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254 /* ImportEqualsDeclaration */; + node.kind = 253 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24477,7 +24494,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(256 /* ImportClause */, fullStart); + var importClause = createNode(255 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24488,7 +24505,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); } return finishNode(importClause); } @@ -24498,8 +24515,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(266 /* ExternalModuleReference */); - parseExpected(140 /* RequireKeyword */); + var node = createNode(265 /* ExternalModuleReference */); + parseExpected(139 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24521,7 +24538,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(257 /* NamespaceImport */); + var namespaceImport = createNode(256 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24536,14 +24553,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264 /* ExportSpecifier */); + return parseImportOrExportSpecifier(263 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259 /* ImportSpecifier */); + return parseImportOrExportSpecifier(258 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24568,34 +24585,34 @@ var ts; else { node.name = identifierName; } - if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263 /* NamespaceExport */, pos); + var node = createNode(262 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(146 /* TypeKeyword */); + node.kind = 260 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(145 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(150 /* FromKeyword */); + if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24603,7 +24620,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260 /* ExportAssignment */; + node.kind = 259 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24623,10 +24640,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ - || node.kind === 255 /* ImportDeclaration */ - || node.kind === 260 /* ExportAssignment */ - || node.kind === 261 /* ExportDeclaration */ ? node : undefined; + || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ + || node.kind === 254 /* ImportDeclaration */ + || node.kind === 259 /* ExportAssignment */ + || node.kind === 260 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24692,7 +24709,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295 /* JSDocTypeExpression */); + var result = createNode(294 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24855,7 +24872,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304 /* JSDocComment */, start); + var result = createNode(303 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24925,19 +24942,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25072,7 +25089,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307 /* JSDocTag */, start); + var result = createNode(306 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25117,9 +25134,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25135,8 +25152,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(324 /* JSDocPropertyTag */, start) : - createNode(318 /* JSDocParameterTag */, start); + createNode(323 /* JSDocPropertyTag */, start) : + createNode(317 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25153,20 +25170,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { + if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25178,7 +25195,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319 /* JSDocReturnTag */, start); + var result = createNode(318 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25187,13 +25204,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321 /* JSDocTypeTag */, start); + var result = createNode(320 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310 /* JSDocAuthorTag */, start); + var result = createNode(309 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25247,20 +25264,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309 /* JSDocImplementsTag */, start); + var result = createNode(308 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308 /* JSDocAugmentsTag */, start); + var result = createNode(307 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25272,7 +25289,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(195 /* PropertyAccessExpression */, node.pos); + var prop = createNode(194 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25285,14 +25302,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320 /* JSDocThisTag */, start); + var tag = createNode(319 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317 /* JSDocEnumTag */, start); + var tag = createNode(316 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25301,7 +25318,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323 /* JSDocTypedefTag */, start); + var typedefTag = createNode(322 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25315,9 +25332,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); } - if (child.kind === 321 /* JSDocTypeTag */) { + if (child.kind === 320 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25330,7 +25347,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25349,7 +25366,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25363,14 +25380,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316 /* JSDocCallbackTag */, start); + var callbackTag = createNode(315 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306 /* JSDocSignature */, start); + var jsdocSignature = createNode(305 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25378,7 +25395,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 319 /* JSDocReturnTag */) { + if (tag && tag.kind === 318 /* JSDocReturnTag */) { return tag; } } @@ -25423,7 +25440,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && + if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25487,13 +25504,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156 /* TypeParameter */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(322 /* JSDocTemplateTag */, start); + var result = createNode(321 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -27802,7 +27819,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282 /* PropertyAssignment */) { + if (element.kind !== 281 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27893,13 +27910,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27916,7 +27933,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30344,26 +30361,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30379,7 +30396,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 251 /* ModuleBlock */: { + case 250 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30401,7 +30418,7 @@ var ts; }); return state_1; } - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30609,7 +30626,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 260 /* ExportAssignment */) { + if (node.kind === 259 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30618,7 +30635,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30646,36 +30663,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "__constructor" /* Constructor */; - case 171 /* FunctionType */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: return "__call" /* Call */; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return "__new" /* New */; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "__index" /* Index */; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 157 /* Parameter */: + case 156 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30775,7 +30792,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30814,7 +30831,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30881,7 +30898,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30914,7 +30931,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30929,13 +30946,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30979,8 +30996,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -31012,90 +31029,93 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: bindWhileStatement(node); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: bindDoStatement(node); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: bindForStatement(node); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: bindIfStatement(node); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: bindTryStatement(node); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: bindSwitchStatement(node); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: bindCaseBlock(node); break; - case 278 /* CaseClause */: + case 277 /* CaseClause */: bindCaseClause(node); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: bindLabeledStatement(node); break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: bindCallExpressionFlow(node); break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 218 /* NonNullExpression */: + bindNonNullExpressionFlow(node); + break; + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 291 /* SourceFile */: { + case 290 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31108,18 +31128,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return hasNarrowableArgument(expr); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31141,7 +31161,7 @@ var ts; } } } - if (expr.expression.kind === 195 /* PropertyAccessExpression */ && + if (expr.expression.kind === 194 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31174,9 +31194,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31252,26 +31272,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return parent.expression === node; - case 231 /* ForStatement */: - case 211 /* ConditionalExpression */: + case 230 /* ForStatement */: + case 210 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201 /* ParenthesizedExpression */) { + if (node.kind === 200 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31313,7 +31333,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239 /* LabeledStatement */) { + while (label && node.parent.kind === 238 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31364,12 +31384,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233 /* ForOfStatement */) { + if (node.kind === 232 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244 /* VariableDeclarationList */) { + if (node.initializer.kind !== 243 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31391,7 +31411,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236 /* ReturnStatement */) { + if (node.kind === 235 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31408,7 +31428,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31508,7 +31528,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31557,7 +31577,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 197 /* CallExpression */) { + if (node.expression.kind === 196 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31583,7 +31603,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31594,10 +31614,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 193 /* ArrayLiteralExpression */) { + else if (node.kind === 192 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214 /* SpreadElement */) { + if (e.kind === 213 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31605,16 +31625,16 @@ var ts; } } } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282 /* PropertyAssignment */) { + if (p.kind === 281 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283 /* ShorthandPropertyAssignment */) { + else if (p.kind === 282 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284 /* SpreadAssignment */) { + else if (p.kind === 283 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31736,7 +31756,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31798,7 +31818,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31837,14 +31857,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162 /* MethodDeclaration */) { + if (host && host.kind !== 161 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31856,15 +31876,17 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: + bind(node.questionDotToken); bind(node.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31882,7 +31904,7 @@ var ts; // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest // of the node as part of the "true" branch, and continue to do so as we ascend back up to the outermost // chain node. We then treat the entire node as the right side of the expression. - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -31903,6 +31925,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -31920,7 +31950,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { + if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31929,7 +31959,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31938,54 +31968,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 275 /* JsxAttributes */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 274 /* JsxAttributes */: return 1 /* IsContainer */; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 301 /* JSDocFunctionType */: - case 171 /* FunctionType */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 172 /* ConstructorType */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 300 /* JSDocFunctionType */: + case 170 /* FunctionType */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 171 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 281 /* CatchClause */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 252 /* CaseBlock */: + case 280 /* CatchClause */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 251 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 224 /* Block */: + case 223 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -32018,45 +32048,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 194 /* ObjectLiteralExpression */: - case 247 /* InterfaceDeclaration */: - case 275 /* JsxAttributes */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 193 /* ObjectLiteralExpression */: + case 246 /* InterfaceDeclaration */: + case 274 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 306 /* JSDocSignature */: - case 168 /* IndexSignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 301 /* JSDocFunctionType */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 305 /* JSDocSignature */: + case 167 /* IndexSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 300 /* JSDocFunctionType */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32157,7 +32187,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32169,7 +32199,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ + var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32201,10 +32231,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32390,8 +32420,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 291 /* SourceFile */ && - blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 290 /* SourceFile */ && + blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32486,7 +32516,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 153 /* LastToken */) { + if (node.kind > 152 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32562,14 +32592,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32584,7 +32614,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32612,78 +32642,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return checkStrictModeCatchClause(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkStrictModeWithStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 184 /* ThisType */: + case 183 /* ThisType */: seenThisKeyword = true; return; - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: break; // Binding the children will handle everything - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return bindTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return bindParameter(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return bindPropertyWorker(node); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: + case 171 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 187 /* MappedType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 186 /* MappedType */: return bindAnonymousTypeWorker(node); - case 311 /* JSDocClassTag */: + case 310 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return bindFunctionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32702,65 +32732,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return bindJsxAttributes(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return bindImportClause(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return bindExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return bindExportAssignment(node); - case 291 /* SourceFile */: + case 290 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224 /* Block */: + case 223 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 318 /* JSDocParameterTag */: - if (node.parent.kind === 306 /* JSDocSignature */) { + case 317 /* JSDocParameterTag */: + if (node.parent.kind === 305 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { break; } // falls through - case 324 /* JSDocPropertyTag */: + case 323 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32916,8 +32946,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32939,11 +32969,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32955,7 +32985,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32985,7 +33015,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -33025,7 +33055,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33127,8 +33157,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ - : propertyAccess.parent.parent.kind === 291 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ + : propertyAccess.parent.parent.kind === 290 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33207,7 +33237,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246 /* ClassDeclaration */) { + if (node.kind === 245 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33270,7 +33300,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { + if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33347,7 +33377,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 182 /* InferType */) { + else if (node.parent.kind === 181 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33375,11 +33405,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || // report error on class declarations - node.kind === 246 /* ClassDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33423,12 +33453,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33477,58 +33507,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 157 /* Parameter */: + case 156 /* Parameter */: return computeParameter(node, subtreeFlags); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163 /* Constructor */: + case 162 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33579,12 +33609,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33632,8 +33662,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 218 /* AsExpression */ - || expressionKind === 200 /* TypeAssertionExpression */) { + if (expressionKind === 217 /* AsExpression */ + || expressionKind === 199 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33981,13 +34011,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33996,27 +34026,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 219 /* NonNullExpression */: - case 139 /* ReadonlyKeyword */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 218 /* NonNullExpression */: + case 138 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: case 11 /* JsxText */: - case 270 /* JsxClosingElement */: - case 271 /* JsxFragment */: - case 272 /* JsxOpeningFragment */: - case 273 /* JsxClosingFragment */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 277 /* JsxExpression */: + case 269 /* JsxClosingElement */: + case 270 /* JsxFragment */: + case 271 /* JsxOpeningFragment */: + case 272 /* JsxClosingFragment */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 276 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -34029,16 +34059,16 @@ var ts; break; } // falls through - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 212 /* TemplateExpression */: - case 283 /* ShorthandPropertyAssignment */: + case 211 /* TemplateExpression */: + case 282 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34055,70 +34085,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 169 /* TypePredicate */: - case 170 /* TypeReference */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 173 /* TypeQuery */: - case 174 /* TypeLiteral */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 182 /* InferType */: - case 183 /* ParenthesizedType */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: - case 253 /* NamespaceExportDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 168 /* TypePredicate */: + case 169 /* TypeReference */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 172 /* TypeQuery */: + case 173 /* TypeLiteral */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 181 /* InferType */: + case 182 /* ParenthesizedType */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: + case 252 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34130,28 +34160,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34164,29 +34194,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34207,67 +34237,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { + if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 193 /* ArrayLiteralExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 192 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 157 /* Parameter */: + case 156 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 163 /* Constructor */: + case 162 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 144 /* StringKeyword */: - case 142 /* ObjectKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 143 /* StringKeyword */: + case 141 /* ObjectKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 281 /* CatchClause */: + case 280 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: - case 201 /* ParenthesizedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: + case 200 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34442,7 +34472,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 173 /* TypeQuery */) { + if (d.type && d.type.kind === 172 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35084,7 +35114,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35650,7 +35679,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35708,17 +35737,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 192 /* BindingElement */) { + if (declaration.kind === 191 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); } - else if (declaration.kind === 243 /* VariableDeclaration */) { + else if (declaration.kind === 242 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35749,12 +35778,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35774,9 +35803,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226 /* VariableStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 225 /* VariableStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35797,16 +35826,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 /* PropertyDeclaration */ && + current.parent.kind === 159 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 162 /* MethodDeclaration */) { + if (declaration.kind === 161 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35828,19 +35857,19 @@ var ts; return "quit"; } switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224 /* Block */: + case 223 /* Block */: switch (node.parent.kind) { - case 164 /* GetAccessor */: - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return true; default: return false; @@ -35886,12 +35915,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 157 /* Parameter */ || - lastLocation.kind === 156 /* TypeParameter */ + lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 155 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35908,13 +35937,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181 /* ConditionalType */) { + else if (location.kind === 180 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35929,14 +35958,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35960,7 +35989,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { break; } } @@ -35974,12 +36003,12 @@ var ts; } } break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35996,9 +36025,9 @@ var ts; } } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -36017,7 +36046,7 @@ var ts; } break loop; } - if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36025,7 +36054,7 @@ var ts; } } break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -36045,9 +36074,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36055,24 +36084,24 @@ var ts; } } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36085,7 +36114,7 @@ var ts; } } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36094,7 +36123,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 157 /* Parameter */) { + if (location.parent && location.parent.kind === 156 /* Parameter */) { location = location.parent; } // @@ -36109,25 +36138,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { location = location.parent; } break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 157 /* Parameter */: + case 156 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157 /* Parameter */) { + if (root.kind === 156 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36147,7 +36176,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36264,10 +36293,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { + if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36280,12 +36309,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: // For `namespace N { N; }` + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36297,7 +36326,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156 /* TypeParameter */) { + if (decl.kind === 155 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36353,9 +36382,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36399,7 +36428,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36458,7 +36487,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36493,13 +36522,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36523,28 +36552,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36845,28 +36874,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 260 /* ExportAssignment */: - case 210 /* BinaryExpression */: + case 259 /* ExportAssignment */: + case 209 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -37018,13 +37047,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -37048,9 +37077,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { - var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { + var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37085,7 +37114,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37307,7 +37336,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37594,7 +37623,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37681,12 +37710,12 @@ var ts; } } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37695,9 +37724,9 @@ var ts; return { value: result }; } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37780,7 +37809,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37824,7 +37853,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37839,10 +37868,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: continue; default: return false; @@ -37973,10 +38002,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38023,14 +38052,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 173 /* TypeQuery */ || + if (entityName.parent.kind === 172 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155 /* ComputedPropertyName */) { + entityName.parent.kind === 154 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || - entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || + entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38079,10 +38108,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38202,23 +38231,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* StringKeyword */); + return ts.createKeywordTypeNode(143 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* NumberKeyword */); + return ts.createKeywordTypeNode(140 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152 /* BigIntKeyword */); + return ts.createKeywordTypeNode(151 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129 /* BooleanKeyword */); + return ts.createKeywordTypeNode(128 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38259,7 +38288,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38267,7 +38296,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38275,15 +38304,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138 /* NeverKeyword */); + return ts.createKeywordTypeNode(137 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145 /* SymbolKeyword */); + return ts.createKeywordTypeNode(144 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142 /* ObjectKeyword */); + return ts.createKeywordTypeNode(141 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38332,7 +38361,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38359,11 +38388,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728 /* Awaited */) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); - } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38408,7 +38432,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38438,7 +38462,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; + return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38489,12 +38513,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); return signatureNode; } } @@ -38515,7 +38539,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38529,12 +38553,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38629,11 +38653,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38710,7 +38734,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38727,7 +38751,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38736,8 +38760,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38788,7 +38812,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38801,7 +38825,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38815,7 +38839,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38859,9 +38883,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38873,7 +38897,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38892,7 +38916,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192 /* BindingElement */) { + if (clone.kind === 191 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -39033,7 +39057,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39339,8 +39363,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39679,8 +39703,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39795,7 +39819,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39888,7 +39912,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39920,7 +39944,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39930,13 +39954,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39945,24 +39969,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39970,11 +39994,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 210 /* BinaryExpression */: - case 195 /* PropertyAccessExpression */: + case 209 /* BinaryExpression */: + case 194 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40195,17 +40219,17 @@ var ts; return result; function visitExistingNodeTreeSymbols(node) { // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 302 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40474,8 +40498,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); - if (node.kind === 248 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); + if (node.kind === 247 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40483,11 +40507,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 /* ModuleBlock */ && + node.parent.kind === 250 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40546,17 +40570,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40573,28 +40597,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 245 /* FunctionDeclaration */: - case 249 /* EnumDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 248 /* EnumDeclaration */: + case 253 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40602,54 +40626,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 163 /* Constructor */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 157 /* Parameter */: - case 251 /* ModuleBlock */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 170 /* TypeReference */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 183 /* ParenthesizedType */: + case 162 /* Constructor */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 156 /* Parameter */: + case 250 /* ModuleBlock */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 169 /* TypeReference */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 182 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: return false; // Type parameters are always visible - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 291 /* SourceFile */: - case 253 /* NamespaceExportDeclaration */: + case 290 /* SourceFile */: + case 252 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return false; default: return false; @@ -40658,10 +40682,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 264 /* ExportSpecifier */) { + else if (node.parent.kind === 263 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40764,12 +40788,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 244 /* VariableDeclarationList */: - case 259 /* ImportSpecifier */: - case 258 /* NamedImports */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 242 /* VariableDeclaration */: + case 243 /* VariableDeclarationList */: + case 258 /* ImportSpecifier */: + case 257 /* NamedImports */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: return false; default: return true; @@ -40802,7 +40826,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40856,7 +40880,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40871,23 +40895,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ancestor.initializer; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { + if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40913,7 +40937,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 190 /* ObjectBindingPattern */) { + if (pattern.kind === 189 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40986,7 +41010,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40996,11 +41020,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -41019,7 +41043,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -41033,11 +41057,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157 /* Parameter */) { + if (declaration.kind === 156 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); + if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41252,9 +41276,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 163 /* Constructor */ || - thisContainer.kind === 245 /* FunctionDeclaration */ || - (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 /* Constructor */ || + thisContainer.kind === 244 /* FunctionDeclaration */ || + (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41338,7 +41362,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41362,7 +41386,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 /* ObjectBindingPattern */ + return pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41401,7 +41425,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41459,7 +41483,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260 /* ExportAssignment */) { + if (declaration.kind === 259 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41530,7 +41554,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41564,15 +41588,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41640,9 +41664,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 /* BinaryExpression */ || + else if (declaration.kind === 209 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210 /* BinaryExpression */) { + declaration.parent.kind === 209 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41709,7 +41733,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41808,36 +41832,36 @@ var ts; return undefined; } switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: - case 316 /* JSDocCallbackTag */: - case 187 /* MappedType */: - case 181 /* ConditionalType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 186 /* MappedType */: + case 180 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187 /* MappedType */) { + if (node.kind === 186 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181 /* ConditionalType */) { + else if (node.kind === 180 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41845,7 +41869,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41855,9 +41879,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 246 /* ClassDeclaration */ || - node.kind === 215 /* ClassExpression */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || + node.kind === 214 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42075,7 +42099,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42111,7 +42135,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */) { + if (declaration.kind === 246 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42199,7 +42223,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210 /* BinaryExpression */) { + else if (expr.kind === 209 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42214,12 +42238,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42233,7 +42257,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42260,7 +42284,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42333,22 +42357,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: - case 188 /* LiteralType */: + case 137 /* NeverKeyword */: + case 187 /* LiteralType */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isThislessType(node.elementType); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42374,7 +42398,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42390,14 +42414,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -43313,8 +43337,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 185 /* TypeOperator */ && - constraintDeclaration.operator === 135 /* KeyOfKeyword */; + return constraintDeclaration.kind === 184 /* TypeOperator */ && + constraintDeclaration.operator === 134 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43539,7 +43563,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432 /* Instantiable */) { + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43575,7 +43599,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43677,10 +43701,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728 /* Awaited */) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43752,7 +43772,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -44040,10 +44060,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 300 /* JSDocOptionalType */ + node.type && node.type.kind === 299 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44077,7 +44097,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44159,7 +44179,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188 /* LiteralType */) { + if (type && type.kind === 187 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -44172,16 +44192,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && + if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 /* Constructor */ ? + var classType = declaration.kind === 162 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44246,11 +44266,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return node.name.kind === 155 /* ComputedPropertyName */ + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return node.name.kind === 154 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44322,7 +44342,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 /* ThisType */ ? + return parameterName.kind === 183 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44365,7 +44385,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163 /* Constructor */) { + if (declaration.kind === 162 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44375,12 +44395,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44470,7 +44490,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; + var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44484,7 +44504,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44518,13 +44538,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182 /* InferType */) { + if (declaration.parent.kind === 181 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 170 /* TypeReference */) { + if (grandParent.kind === 169 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44549,7 +44569,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44574,7 +44594,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44583,7 +44603,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44663,8 +44683,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44708,7 +44728,7 @@ var ts; return errorType; } } - if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44753,9 +44773,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44822,7 +44842,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44848,7 +44868,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -44857,9 +44877,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -44870,7 +44890,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44983,9 +45003,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return declaration; } } @@ -45106,19 +45126,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { + if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45127,15 +45147,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183 /* ParenthesizedType */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 186 /* IndexedAccessType */: - case 181 /* ConditionalType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 185 /* IndexedAccessType */: + case 180 /* ConditionalType */: + case 184 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } return false; @@ -45144,27 +45164,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; - case 185 /* TypeOperator */: - return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 300 /* JSDocOptionalType */: - case 298 /* JSDocNullableType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 184 /* TypeOperator */: + return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 299 /* JSDocOptionalType */: + case 297 /* JSDocNullableType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 178 /* RestType */: - return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 177 /* RestType */: + return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 178 /* UnionType */: + case 179 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45178,18 +45198,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45294,7 +45314,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 201064448 /* StructuredOrInstantiable */) + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45426,7 +45446,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45780,7 +45800,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45802,24 +45822,20 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ + case 147 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128 /* AwaitedKeyword */: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -45854,13 +45870,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45871,7 +45887,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -46008,9 +46024,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -46021,7 +46037,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -46031,7 +46047,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -46084,7 +46100,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 197394432 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46156,7 +46172,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46469,7 +46485,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46716,7 +46732,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46752,88 +46768,88 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return anyType; - case 149 /* UnknownKeyword */: + case 148 /* UnknownKeyword */: return unknownType; - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return stringType; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return numberType; - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return bigintType; - case 129 /* BooleanKeyword */: + case 128 /* BooleanKeyword */: return booleanType; - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return neverType; - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getTypeFromTypeReference(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 183 /* ParenthesizedType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 182 /* ParenthesizedType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 178 /* RestType */: + case 177 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 182 /* InferType */: + case 181 /* InferType */: return getTypeFromInferTypeNode(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47041,9 +47057,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 /* QualifiedName */ || - node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 /* QualifiedName */ || + node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -47052,7 +47068,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47061,12 +47077,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -47098,7 +47114,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -47216,7 +47232,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { return getMappedType(type, mapper); @@ -47264,9 +47279,6 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728 /* Awaited */) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432 /* Substitution */) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { @@ -47308,35 +47320,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274 /* JsxAttribute */: { + case 273 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277 /* JsxExpression */: { + case 276 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47355,7 +47367,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47368,7 +47380,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47421,7 +47433,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47471,23 +47483,23 @@ var ts; return true; } switch (node.kind) { - case 277 /* JsxExpression */: - case 201 /* ParenthesizedExpression */: + case 276 /* JsxExpression */: + case 200 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47678,7 +47690,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47687,9 +47699,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47840,11 +47852,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165 /* SetAccessor */: return [3 /*break*/, 2]; - case 164 /* GetAccessor */: return [3 /*break*/, 2]; - case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 164 /* SetAccessor */: return [3 /*break*/, 2]; + case 163 /* GetAccessor */: return [3 /*break*/, 2]; + case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47921,8 +47933,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && - kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && + kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48183,7 +48195,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48593,7 +48605,7 @@ var ts; result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } } - if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48958,8 +48970,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -49086,17 +49097,6 @@ var ts; } } } - else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - // An `awaited S` is related to an `awaited T` if `S` is related to `T`: - // - // S <: T ⇒ awaited S <: awaited T - // - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49214,21 +49214,6 @@ var ts; } } } - else if (source.flags & 134217728 /* Awaited */) { - // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the - // constraint of `S`: - // - // S <: C ^ awaited C <: T ⇒ awaited S <: T - // - // For example `awaited Promise` is assignable to `number`. - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -50080,11 +50065,13 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } } variances.push(variance); }; @@ -50857,12 +50844,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210 /* BinaryExpression */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 209 /* BinaryExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157 /* Parameter */: + case 156 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50877,23 +50864,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50907,7 +50894,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187 /* MappedType */: + case 186 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -51035,7 +51022,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 197394432 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51331,7 +51318,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 197394432 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51366,9 +51353,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51376,10 +51360,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728 /* Awaited */) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51393,7 +51373,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51505,34 +51485,10 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576 /* Union */) { var nakedTypeVariable = void 0; - for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { - var t = targets_2[_i]; - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - } - // To better support backwards compatibility with the new `awaited` type, we detect a target - // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, - // we infer from source to the type parameter `T`, where each type of source is mapped to extract - // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } var sources = source.flags & 1048576 /* Union */ ? source.types : [source]; var matched_1 = new Array(sources.length); var inferenceCircularity = false; @@ -51540,9 +51496,13 @@ var ts; // track whether inferences were made from that particular type to some target with // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t = targets_2[_i]; + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512 /* MaxValue */; @@ -51580,8 +51540,8 @@ var ts; // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -51595,8 +51555,8 @@ var ts; // we want to infer string for T, not Promise | string. For intersection types // we only infer to single naked type variables. if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1 /* NakedTypeVariable */); } @@ -51753,7 +51713,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; + bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51923,7 +51883,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51944,7 +51904,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51959,11 +51919,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51974,24 +51934,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201 /* ParenthesizedExpression */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && + (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -52001,11 +51961,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -52034,7 +51994,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -52067,7 +52027,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -52185,7 +52145,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 197394432 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52222,15 +52182,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52247,21 +52207,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return stringType; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return undefinedType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52269,7 +52229,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 /* ObjectBindingPattern */ ? + var type = pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52287,30 +52247,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232 /* ForInStatement */) { + if (node.parent.parent.kind === 231 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.parent.kind === 232 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 /* VariableDeclaration */ ? + return node.kind === 242 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 /* VariableDeclaration */ && node.initializer && + return node.kind === 242 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && + node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52322,13 +52282,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 /* ParenthesizedExpression */ || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 200 /* ParenthesizedExpression */ || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52348,7 +52308,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52510,12 +52470,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 /* CallExpression */ + parent.parent.kind === 196 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 210 /* BinaryExpression */ && + parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52523,8 +52483,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || - declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && + return (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || + declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52537,7 +52497,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, /*diagnostic*/ undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -52563,11 +52523,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52581,7 +52541,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52625,7 +52585,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52700,7 +52660,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52712,7 +52672,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52793,8 +52753,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 195 /* PropertyAccessExpression */ && - reference.kind !== 196 /* ElementAccessExpression */ && + reference.kind !== 194 /* PropertyAccessExpression */ && + reference.kind !== 195 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52819,7 +52779,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52859,14 +52819,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { + if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52877,7 +52837,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52908,7 +52868,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 /* CallExpression */ ? + var expr = node.kind === 196 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52916,7 +52876,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52966,7 +52926,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52974,7 +52934,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -53186,10 +53146,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -53313,7 +53273,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 210 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 209 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53337,7 +53297,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53407,7 +53367,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53621,16 +53581,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53675,9 +53635,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 /* ModuleBlock */ || - node.kind === 291 /* SourceFile */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 250 /* ModuleBlock */ || + node.kind === 290 /* SourceFile */ || + node.kind === 159 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53699,7 +53659,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { symbol.isAssigned = true; } } @@ -53715,7 +53675,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 /* Parameter */ && + declaration.kind === 156 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53729,13 +53689,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 /* PropertyAccessExpression */ || - parent.kind === 197 /* CallExpression */ && parent.expression === node || - parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 194 /* PropertyAccessExpression */ || + parent.kind === 196 /* CallExpression */ && parent.expression === node || + parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53774,7 +53734,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { 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 /* Async */)) { @@ -53795,7 +53755,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 246 /* ClassDeclaration */ + if (declaration.kind === 245 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53807,14 +53767,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215 /* ClassExpression */) { + else if (declaration.kind === 214 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 291 /* SourceFile */) { + while (container.kind !== 290 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53863,7 +53823,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53872,8 +53832,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || - flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || + flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53882,9 +53842,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || - node.parent.kind === 219 /* NonNullExpression */ || - declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || + node.parent.kind === 218 /* NonNullExpression */ || + declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53919,7 +53879,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53942,7 +53902,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53963,7 +53923,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53982,7 +53942,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 201 /* ParenthesizedExpression */) { + while (current.parent.kind === 200 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53990,7 +53950,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -54003,7 +53963,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { + if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -54071,37 +54031,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 163 /* Constructor */) { + if (container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 163 /* Constructor */: + case 162 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -54151,7 +54111,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && + (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -54198,7 +54158,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 202 /* FunctionExpression */ && + if (container.kind === 201 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -54208,16 +54168,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 162 /* MethodDeclaration */ && - container.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 161 /* MethodDeclaration */ && + container.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 202 /* FunctionExpression */ && - container.parent.kind === 282 /* PropertyAssignment */ && - container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && + container.parent.kind === 281 /* PropertyAssignment */ && + container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -54225,7 +54185,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 202 /* FunctionExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -54250,7 +54210,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -54264,15 +54224,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 203 /* ArrowFunction */) { + while (container && container.kind === 202 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54285,14 +54245,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); - if (current && current.kind === 155 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); + if (current && current.kind === 154 /* ComputedPropertyName */) { 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 === 194 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54300,7 +54260,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163 /* Constructor */) { + if (!isCallExpression && container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54369,7 +54329,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54383,7 +54343,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (container.parent.kind === 193 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54404,7 +54364,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54419,7 +54379,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 163 /* Constructor */; + return container.kind === 162 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54427,21 +54387,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */; } else { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */ || - container.kind === 160 /* PropertyDeclaration */ || - container.kind === 159 /* PropertySignature */ || - container.kind === 163 /* Constructor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */ || + container.kind === 159 /* PropertyDeclaration */ || + container.kind === 158 /* PropertySignature */ || + container.kind === 162 /* Constructor */; } } } @@ -54449,10 +54409,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 /* MethodDeclaration */ || - func.kind === 164 /* GetAccessor */ || - func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 161 /* MethodDeclaration */ || + func.kind === 163 /* GetAccessor */ || + func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54464,7 +54424,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54491,7 +54451,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282 /* PropertyAssignment */) { + if (literal.parent.kind !== 281 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54505,7 +54465,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54558,9 +54518,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157 /* Parameter */: + case 156 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54569,7 +54529,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54610,9 +54570,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54624,9 +54581,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54697,7 +54651,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199 /* TaggedTemplateExpression */) { + if (template.parent.kind === 198 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54933,21 +54887,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return true; - case 195 /* PropertyAccessExpression */: - case 201 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 200 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54972,7 +54926,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54995,7 +54949,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -55033,58 +54987,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 191 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 203 /* ArrowFunction */: - case 236 /* ReturnStatement */: + case 202 /* ArrowFunction */: + case 235 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 198 /* NewExpression */: + case 197 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193 /* ArrayLiteralExpression */: { + case 192 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); + case 221 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -55241,7 +55195,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; + return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -55255,7 +55209,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55300,8 +55254,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 /* BindingElement */ && !!node.initializer) || - (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 191 /* BindingElement */ && !!node.initializer) || + (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55314,7 +55268,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 /* SpreadElement */ && e.expression; + var spread = e.kind === 213 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55400,7 +55354,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55491,7 +55445,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55505,13 +55459,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 /* PropertyAssignment */ || - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 281 /* PropertyAssignment */ || + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55534,8 +55488,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55561,7 +55515,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284 /* SpreadAssignment */) { + else if (memberDecl.kind === 283 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55590,7 +55544,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55615,7 +55569,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55657,13 +55611,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55759,7 +55713,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55785,7 +55739,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -56215,7 +56169,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56374,7 +56328,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201 /* ParenthesizedExpression */) { + while (node.parent.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56527,7 +56481,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56559,8 +56513,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && - node.parent.kind !== 170 /* TypeReference */ && + else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && + node.parent.kind !== 169 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56572,22 +56526,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return true; - case 282 /* PropertyAssignment */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 284 /* SpreadAssignment */: - case 155 /* ComputedPropertyName */: - case 222 /* TemplateSpan */: - case 277 /* JsxExpression */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 269 /* JsxOpeningElement */: - case 217 /* ExpressionWithTypeArguments */: - case 280 /* HeritageClause */: + case 281 /* PropertyAssignment */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 283 /* SpreadAssignment */: + case 154 /* ComputedPropertyName */: + case 221 /* TemplateSpan */: + case 276 /* JsxExpression */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 268 /* JsxOpeningElement */: + case 216 /* ExpressionWithTypeArguments */: + case 279 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56776,16 +56730,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 189 /* ImportType */: + case 188 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56808,7 +56762,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer.kind === 243 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56837,7 +56791,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 /* ForInStatement */ && + if (node.kind === 231 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56921,13 +56875,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158 /* Decorator */) { + else if (node.kind !== 157 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56991,7 +56945,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -57005,9 +56959,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 212 /* TemplateExpression */) { + if (node.template.kind === 211 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -57022,7 +56976,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158 /* Decorator */) { + else if (node.kind === 157 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -57037,7 +56991,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 198 /* NewExpression */); + ts.Debug.assert(node.kind === 197 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -57130,7 +57084,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 158 /* Decorator */) { + if (node.kind !== 157 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -57173,7 +57127,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -57187,7 +57141,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -57197,7 +57151,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 221 /* SyntheticExpression */ ? + return arg.kind === 220 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57352,7 +57306,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57382,7 +57336,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57423,7 +57377,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57431,7 +57385,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57441,17 +57395,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158 /* Decorator */) { + if (node.kind === 157 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57481,30 +57435,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157 /* Parameter */: + case 156 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57518,17 +57472,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 1; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return 2; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 157 /* Parameter */: + case 156 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57653,8 +57607,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 158 /* Decorator */; + var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 157 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57716,7 +57670,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -58232,7 +58186,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 163 /* Constructor */) { + if (!modifiers || declaration.kind !== 162 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58363,16 +58317,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58463,16 +58417,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158 /* Decorator */: + case 157 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58561,7 +58515,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195 /* PropertyAccessExpression */) { + while (parent && parent.kind === 194 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58586,12 +58540,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 198 /* NewExpression */) { + if (node.kind === 197 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 /* Constructor */ && - declaration.kind !== 167 /* ConstructSignature */ && - declaration.kind !== 172 /* ConstructorType */ && + declaration.kind !== 162 /* Constructor */ && + declaration.kind !== 166 /* ConstructSignature */ && + declaration.kind !== 171 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58611,7 +58565,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && + if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58718,9 +58672,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 245 /* FunctionDeclaration */ + ? 244 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 243 /* VariableDeclaration */ + ? 242 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58748,18 +58702,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return true; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58790,8 +58744,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -58809,7 +58769,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163 /* Constructor */) { + else if (container.kind === 162 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -59035,7 +58995,7 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -59045,7 +59005,7 @@ var ts; var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -59076,7 +59036,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -59263,7 +59223,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205 /* TypeOfExpression */) { + if (node.expression.kind === 204 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -59322,11 +59282,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 162 /* MethodDeclaration */: - return func.parent.kind === 194 /* ObjectLiteralExpression */; + case 161 /* MethodDeclaration */: + return func.parent.kind === 193 /* ObjectLiteralExpression */; default: return false; } @@ -59352,7 +59312,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59385,7 +59345,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59409,7 +59369,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59462,7 +59422,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59475,7 +59435,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224 /* Block */) { + if (node.body.kind === 223 /* Block */) { checkSourceElement(node.body); } else { @@ -59565,7 +59525,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163 /* Constructor */)) { + if (!(ctor && ctor.kind === 162 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59590,7 +59550,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257 /* NamespaceImport */; + return !!declaration && declaration.kind === 256 /* NamespaceImport */; } } } @@ -59598,7 +59558,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { // References are combinations of identifiers, parentheses, and property accesses. - var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); + var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 75 /* Identifier */ && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -59616,7 +59576,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59666,7 +59626,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59838,7 +59798,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59858,7 +59818,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59871,9 +59831,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 284 /* SpreadAssignment */) { + else if (property.kind === 283 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59916,8 +59876,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216 /* OmittedExpression */) { - if (element.kind !== 214 /* SpreadElement */) { + if (element.kind !== 215 /* OmittedExpression */) { + if (element.kind !== 213 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59935,7 +59895,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59951,7 +59911,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59967,24 +59927,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194 /* ObjectLiteralExpression */) { + if (target.kind === 193 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193 /* ArrayLiteralExpression */) { + if (target.kind === 192 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 /* SpreadAssignment */ ? + var error = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -60009,36 +59969,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 199 /* TaggedTemplateExpression */: - case 212 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 147 /* UndefinedKeyword */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 205 /* TypeOfExpression */: - case 219 /* NonNullExpression */: - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: + case 146 /* UndefinedKeyword */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 204 /* TypeOfExpression */: + case 218 /* NonNullExpression */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: return true; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -60050,9 +60010,9 @@ var ts; } return false; // Some forms listed here for clarity - case 206 /* VoidExpression */: // Explicit opt-out - case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 205 /* VoidExpression */: // Explicit opt-out + case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -60084,7 +60044,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -60151,7 +60111,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60556,7 +60516,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60605,13 +60565,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; + return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60621,7 +60581,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60650,7 +60610,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60687,7 +60647,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60698,7 +60658,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60932,11 +60892,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums 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_or_type_query); } @@ -60961,9 +60921,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60989,78 +60949,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return checkQualifiedName(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checkCallExpression(node, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return checkClassExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return checkAssertion(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return checkNonNullAssertion(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return checkMetaProperty(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkDeleteExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return checkVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return checkAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return undefinedWideningType; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return checkYieldExpression(node); - case 221 /* SyntheticExpression */: + case 220 /* SyntheticExpression */: return node.type; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return checkJsxElement(node, checkMode); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return checkJsxFragment(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -61097,10 +61057,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -61111,13 +61071,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { + if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + if (func.kind === 163 /* GetAccessor */ || func.kind === 164 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -61175,13 +61135,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203 /* ArrowFunction */: - case 166 /* CallSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 171 /* FunctionType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 202 /* ArrowFunction */: + case 165 /* CallSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 170 /* FunctionType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -61199,7 +61159,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { + else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -61208,13 +61168,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || - node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || - node.kind === 167 /* ConstructSignature */) { + else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || + node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || + node.kind === 166 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -61244,10 +61204,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -61277,7 +61237,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { + if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -61289,7 +61249,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163 /* Constructor */) { + if (member.kind === 162 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -61309,16 +61269,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61381,7 +61341,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159 /* PropertySignature */) { + if (member.kind === 158 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61406,7 +61366,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61426,7 +61386,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61434,7 +61394,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61476,7 +61436,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61504,7 +61464,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 /* PropertyDeclaration */ && + return n.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61534,7 +61494,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61559,7 +61519,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61569,7 +61529,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61578,7 +61538,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61596,7 +61556,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61644,7 +61604,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61689,7 +61649,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178 /* RestType */) { + if (e.kind === 177 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61698,7 +61658,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177 /* OptionalType */) { + else if (e.kind === 176 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61719,7 +61679,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61770,7 +61730,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61787,9 +61747,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 247 /* InterfaceDeclaration */ && - n.parent.kind !== 246 /* ClassDeclaration */ && - n.parent.kind !== 215 /* ClassExpression */ && + if (n.parent.kind !== 246 /* InterfaceDeclaration */ && + n.parent.kind !== 245 /* ClassDeclaration */ && + n.parent.kind !== 214 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61885,7 +61845,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && + var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61925,7 +61885,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61936,10 +61896,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { + if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -62070,25 +62030,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return 2 /* ExportType */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -62096,17 +62056,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 245 /* FunctionDeclaration */: - case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 244 /* FunctionDeclaration */: + case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -62146,9 +62106,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { @@ -62185,28 +62144,6 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - /** - * Gets or creates an `awaited T` type for a generic type. - * - * The "awaited type" of a generic type cannot be determined until it is instantiated. As - * a result, an `AwaitedType` for the generic type is created that can be instantiated - * or related later. - */ - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728 /* Awaited */); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; - } /** * Determines whether a type has a callable `then` member. */ @@ -62214,32 +62151,6 @@ var ts; var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; } - /** - * Determines whether a type is a generic type whose base constraint could possibly resolve to a different - * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: - * - The type is a generic object type, - * - AND one of the following conditions are met - * - The type has no base constraint, - * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, - * - OR The base constraint has a callable `then` member. - * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a - * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound - * behavior is much more developer friendly. - */ - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152 /* Intersection */) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } /** * Gets the "awaited type" of a type. * @@ -62248,60 +62159,22 @@ var ts; * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a * non-promise type is found. * - * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` - * type. + * This is used to reflect the runtime behavior of the `await` keyword. */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } // For a union, get a union of the awaited types of each constituent. // - // For example: - // - // awaited (number | string) -> number | string - // awaited (number | Promise) -> number | string - // awaited (T | string) -> awaited T | string - // awaited (T | Promise) -> awaited T | string - // awaited (T | Promise) -> awaited T - // awaited (T | U) -> awaited T | awaited U - // return typeAsAwaitable.awaitedTypeOfType = mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } - // We cannot resolve the awaited type for a type variable until it is instantiated. As - // such, we create an `awaited T` type that can either be instantiated or related later. - // - // For example: - // - // T -> awaited T - // - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -62485,24 +62358,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157 /* Parameter */: + case 156 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62549,14 +62422,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; } } @@ -62565,13 +62438,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62617,14 +62490,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62633,23 +62506,23 @@ var ts; } } break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157 /* Parameter */: + case 156 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62712,7 +62585,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62753,7 +62626,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62766,7 +62639,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62795,7 +62668,7 @@ var ts; } } } - var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62837,42 +62710,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291 /* SourceFile */: - case 250 /* ModuleDeclaration */: - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 290 /* SourceFile */: + case 249 /* ModuleDeclaration */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182 /* InferType */: + case 181 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62892,11 +62765,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162 /* MethodDeclaration */: - case 160 /* PropertyDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 161 /* MethodDeclaration */: + case 159 /* PropertyDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62907,7 +62780,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62915,8 +62788,8 @@ var ts; } } break; - case 168 /* IndexSignature */: - case 223 /* SemicolonClassElement */: + case 167 /* IndexSignature */: + case 222 /* SemicolonClassElement */: // Can't be private break; default: @@ -62943,7 +62816,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -63026,7 +62899,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -63044,7 +62917,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -63065,7 +62938,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -63079,22 +62952,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; + return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 224 /* Block */) { + if (node.kind === 223 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -63124,12 +62997,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 /* PropertyDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 162 /* MethodDeclaration */ || - node.kind === 161 /* MethodSignature */ || - node.kind === 164 /* GetAccessor */ || - node.kind === 165 /* SetAccessor */) { + if (node.kind === 159 /* PropertyDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 161 /* MethodDeclaration */ || + node.kind === 160 /* MethodSignature */ || + node.kind === 163 /* GetAccessor */ || + node.kind === 164 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -63138,7 +63011,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -63195,7 +63068,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63210,7 +63083,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63245,7 +63118,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -63257,17 +63130,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 251 /* ModuleBlock */ || - container.kind === 250 /* ModuleDeclaration */ || - container.kind === 291 /* SourceFile */); + (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 250 /* ModuleBlock */ || + container.kind === 249 /* ModuleDeclaration */ || + container.kind === 290 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -63297,18 +63170,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192 /* BindingElement */) { - if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 191 /* BindingElement */) { + if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -63329,19 +63202,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -63378,7 +63251,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -63404,10 +63277,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { + if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -63419,7 +63292,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ + var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63429,8 +63302,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || - (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { + if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || + (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63470,7 +63343,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225 /* EmptyStatement */) { + if (node.thenStatement.kind === 224 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63541,12 +63414,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63580,14 +63453,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63619,7 +63492,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { 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); @@ -63633,7 +63506,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63646,7 +63519,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -64286,7 +64159,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -64308,12 +64181,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165 /* SetAccessor */) { + if (func.kind === 164 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163 /* Constructor */) { + else if (func.kind === 162 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -64321,7 +64194,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -64331,7 +64204,7 @@ var ts; } } } - else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -64360,7 +64233,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -64369,7 +64242,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -64401,7 +64274,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64508,8 +64381,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 /* BinaryExpression */ || - name.kind === 155 /* ComputedPropertyName */ || + (propDeclaration.kind === 209 /* BinaryExpression */ || + name.kind === 154 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64586,7 +64459,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170 /* TypeReference */) { + if (node.kind === 169 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64832,7 +64705,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; + return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64887,7 +64760,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215 /* ClassExpression */) { + if (derivedClassDecl.kind === 214 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64909,7 +64782,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64924,7 +64797,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -65021,7 +64894,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 /* PropertyDeclaration */ && + return node.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -65045,7 +64918,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -65151,7 +65024,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -65161,7 +65034,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -65190,7 +65063,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -65198,14 +65071,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 195 /* PropertyAccessExpression */) { + if (ex.kind === 194 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -65235,8 +65108,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -65272,7 +65145,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 249 /* EnumDeclaration */) { + if (declaration.kind !== 248 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -65300,8 +65173,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 /* ClassDeclaration */ || - (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 /* ClassDeclaration */ || + (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -65364,7 +65237,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -65414,23 +65287,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192 /* BindingElement */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 242 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65441,12 +65314,12 @@ var ts; break; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 245 /* FunctionDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65469,12 +65342,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65494,9 +65367,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65531,14 +65404,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 /* ExportSpecifier */ ? + var message = node.kind === 263 /* ExportSpecifier */ ? 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)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 264 /* ExportSpecifier */ + && node.kind === 263 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65566,7 +65439,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65590,7 +65463,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65635,10 +65508,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65656,14 +65529,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65719,8 +65592,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65834,165 +65707,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return checkTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return checkParameter(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return checkPropertySignature(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return checkSignatureDeclaration(node); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return checkMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return checkConstructorDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return checkAccessorDeclaration(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return checkTypeReferenceNode(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return checkTypePredicate(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return checkTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return checkTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return checkArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return checkTupleType(node); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 178 /* RestType */: + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 177 /* RestType */: return checkSourceElement(node.type); - case 184 /* ThisType */: + case 183 /* ThisType */: return checkThisType(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return checkTypeOperator(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return checkConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return checkInferType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return checkImportType(node); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: - case 305 /* JSDocTypeLiteral */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: + case 304 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 295 /* JSDocTypeExpression */: + case 294 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return checkMappedType(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return checkBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return checkVariableStatement(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return checkExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return checkIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return checkDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return checkWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return checkForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return checkForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkForOfStatement(node); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return checkReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return checkSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return checkThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return checkTryStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return checkBindingElement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return checkClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return checkImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return checkExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return checkExportAssignment(node); - case 225 /* EmptyStatement */: - case 242 /* DebuggerStatement */: + case 224 /* EmptyStatement */: + case 241 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -66087,33 +65960,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: - case 269 /* JsxOpeningElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: + case 268 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 267 /* JsxElement */: + case 266 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -66256,17 +66129,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -66274,8 +66147,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -66284,7 +66157,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -66332,16 +66205,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156 /* TypeParameter */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 155 /* TypeParameter */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return true; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -66349,16 +66222,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 170 /* TypeReference */; + return node.parent.kind === 169 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195 /* PropertyAccessExpression */) { + while (node.parent.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 217 /* ExpressionWithTypeArguments */; + return node.parent.kind === 216 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -66386,13 +66259,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -66418,7 +66291,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66428,7 +66301,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 /* PropertyAccessExpression */ && + name.parent.kind === 194 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66438,7 +66311,7 @@ var ts; } } } - if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66448,7 +66321,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66466,7 +66339,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66482,10 +66355,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318 /* JSDocParameterTag */) { + if (name.parent.kind === 317 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { + if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66502,12 +66375,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { + else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195 /* PropertyAccessExpression */) { + if (name.kind === 194 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66517,17 +66390,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 169 /* TypePredicate */) { + if (name.parent.kind === 168 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66550,8 +66423,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 /* BindingElement */ && - grandParent.kind === 190 /* ObjectBindingPattern */ && + else if (parent.kind === 191 /* BindingElement */ && + grandParent.kind === 189 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66563,8 +66436,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66578,14 +66451,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 184 /* ThisType */: + case 183 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66596,7 +66469,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66618,7 +66491,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66627,7 +66500,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66698,23 +66571,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 233 /* ForOfStatement */) { + if (expr.parent.kind === 232 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 210 /* BinaryExpression */) { + if (expr.parent.kind === 209 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 282 /* PropertyAssignment */) { + if (expr.parent.kind === 281 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66762,7 +66635,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66818,7 +66691,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66874,7 +66747,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66902,7 +66775,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66933,7 +66806,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66974,19 +66847,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66995,7 +66868,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -67097,15 +66970,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285 /* EnumMember */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 284 /* EnumMember */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285 /* EnumMember */) { + if (node.kind === 284 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -67346,12 +67219,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; + var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -67367,7 +67240,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -67376,7 +67249,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; + return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -67388,7 +67261,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67439,7 +67312,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67467,12 +67340,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67664,14 +67537,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 /* MethodDeclaration */ && !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 === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { + else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { 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); @@ -67688,17 +67561,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139 /* ReadonlyKeyword */) { - if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { + if (modifier.kind !== 138 /* ReadonlyKeyword */) { + if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 249 /* EnumDeclaration */) { + if (node.kind !== 248 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67718,7 +67591,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67744,10 +67617,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67759,11 +67632,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { + else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67786,19 +67659,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67808,10 +67681,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67824,14 +67697,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246 /* ClassDeclaration */) { - if (node.kind !== 162 /* MethodDeclaration */ && - node.kind !== 160 /* PropertyDeclaration */ && - node.kind !== 164 /* GetAccessor */ && - node.kind !== 165 /* SetAccessor */) { + if (node.kind !== 245 /* ClassDeclaration */) { + if (node.kind !== 161 /* MethodDeclaration */ && + node.kind !== 159 /* PropertyDeclaration */ && + node.kind !== 163 /* GetAccessor */ && + node.kind !== 164 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67853,7 +67726,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67861,7 +67734,7 @@ var ts; break; } } - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67876,13 +67749,13 @@ var ts; } return false; } - else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67903,37 +67776,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 250 /* ModuleDeclaration */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 157 /* Parameter */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 249 /* ModuleDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 156 /* Parameter */: return false; default: - if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return false; } switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 247 /* InterfaceDeclaration */: - case 226 /* VariableStatement */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 225 /* VariableStatement */: + case 247 /* TypeAliasDeclaration */: return true; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67946,10 +67819,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -68064,7 +67937,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 !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { + if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -68106,7 +67979,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216 /* OmittedExpression */) { + if (arg.kind === 215 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -68183,20 +68056,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 162 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 161 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -68215,7 +68088,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */) { + if (prop.kind === 283 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -68226,11 +68099,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -68243,7 +68116,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -68258,10 +68131,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -68269,13 +68142,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -68314,7 +68187,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276 /* JsxSpreadAttribute */) { + if (attr.kind === 275 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -68324,7 +68197,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -68338,14 +68211,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163 /* Constructor */) { + if (func && func.kind !== 162 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -68356,7 +68229,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -68371,20 +68244,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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); @@ -68409,11 +68282,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165 /* SetAccessor */) { + if (accessor.kind === 164 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68435,21 +68308,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148 /* UniqueKeyword */) { - if (node.type.kind !== 145 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); + if (node.operator === 147 /* UniqueKeyword */) { + if (node.type.kind !== 144 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68461,13 +68334,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68476,9 +68349,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139 /* ReadonlyKeyword */) { - if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); + else if (node.operator === 138 /* ReadonlyKeyword */) { + if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); } } } @@ -68491,8 +68364,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162 /* MethodDeclaration */) { - if (node.parent.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 161 /* MethodDeclaration */) { + if (node.parent.kind === 193 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68520,14 +68393,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68538,11 +68411,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68550,8 +68423,8 @@ var ts; return false; } break; - case 238 /* SwitchStatement */: - if (node.kind === 235 /* BreakStatement */ && !node.label) { + case 237 /* SwitchStatement */: + if (node.kind === 234 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68566,13 +68439,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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 === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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); @@ -68596,12 +68469,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68632,7 +68505,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { + if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68645,7 +68518,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68708,15 +68581,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return false; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68800,7 +68673,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68808,7 +68681,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68837,13 +68710,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 248 /* TypeAliasDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 261 /* ExportDeclaration */ || - node.kind === 260 /* ExportAssignment */ || - node.kind === 253 /* NamespaceExportDeclaration */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 247 /* TypeAliasDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 260 /* ExportDeclaration */ || + node.kind === 259 /* ExportAssignment */ || + node.kind === 252 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68852,7 +68725,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 === 226 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68875,7 +68748,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68897,10 +68770,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -69075,14 +68948,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || + return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -69090,14 +68963,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 256 /* ImportClause */: // For default import - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: // For rename import `x as y` + case 255 /* ImportClause */: // For default import + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 259 /* ImportSpecifier */; + return decl.parent.kind === 258 /* ImportSpecifier */; default: return false; } @@ -69360,7 +69233,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(131 /* DeclareKeyword */)); + result.push(createModifier(130 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -69384,7 +69257,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(139 /* ReadonlyKeyword */)); + result.push(createModifier(138 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -69394,7 +69267,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(154 /* QualifiedName */); + var node = createSynthesizedNode(153 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -69413,7 +69286,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155 /* ComputedPropertyName */); + var node = createSynthesizedNode(154 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69426,7 +69299,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156 /* TypeParameter */); + var node = createSynthesizedNode(155 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69442,7 +69315,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157 /* Parameter */); + var node = createSynthesizedNode(156 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69466,7 +69339,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158 /* Decorator */); + var node = createSynthesizedNode(157 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69479,7 +69352,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertySignature */); + var node = createSynthesizedNode(158 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69499,7 +69372,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160 /* PropertyDeclaration */); + var node = createSynthesizedNode(159 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69523,7 +69396,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69540,7 +69413,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162 /* MethodDeclaration */); + var node = createSynthesizedNode(161 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69600,7 +69473,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163 /* Constructor */); + var node = createSynthesizedNode(162 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69620,7 +69493,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164 /* GetAccessor */); + var node = createSynthesizedNode(163 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69643,7 +69516,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165 /* SetAccessor */); + var node = createSynthesizedNode(164 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69664,7 +69537,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69672,7 +69545,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69680,7 +69553,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168 /* IndexSignature */); + var node = createSynthesizedNode(167 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69724,7 +69597,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169 /* TypePredicate */); + var node = createSynthesizedNode(168 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69744,7 +69617,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170 /* TypeReference */); + var node = createSynthesizedNode(169 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69758,7 +69631,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69766,7 +69639,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69774,7 +69647,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173 /* TypeQuery */); + var node = createSynthesizedNode(172 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69786,7 +69659,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174 /* TypeLiteral */); + var node = createSynthesizedNode(173 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69798,7 +69671,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175 /* ArrayType */); + var node = createSynthesizedNode(174 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69810,7 +69683,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176 /* TupleType */); + var node = createSynthesizedNode(175 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69822,7 +69695,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177 /* OptionalType */); + var node = createSynthesizedNode(176 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69834,7 +69707,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178 /* RestType */); + var node = createSynthesizedNode(177 /* RestType */); node.type = type; return node; } @@ -69846,7 +69719,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69854,7 +69727,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69873,7 +69746,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181 /* ConditionalType */); + var node = createSynthesizedNode(180 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69891,7 +69764,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182 /* InferType */); + var node = createSynthesizedNode(181 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69903,7 +69776,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189 /* ImportType */); + var node = createSynthesizedNode(188 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69921,7 +69794,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183 /* ParenthesizedType */); + var node = createSynthesizedNode(182 /* ParenthesizedType */); node.type = type; return node; } @@ -69933,12 +69806,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184 /* ThisType */); + return createSynthesizedNode(183 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; + var node = createSynthesizedNode(184 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69948,7 +69821,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186 /* IndexedAccessType */); + var node = createSynthesizedNode(185 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69962,7 +69835,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187 /* MappedType */); + var node = createSynthesizedNode(186 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69980,7 +69853,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188 /* LiteralType */); + var node = createSynthesizedNode(187 /* LiteralType */); node.literal = literal; return node; } @@ -69993,7 +69866,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ObjectBindingPattern */); + var node = createSynthesizedNode(189 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70005,7 +69878,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191 /* ArrayBindingPattern */); + var node = createSynthesizedNode(190 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70017,7 +69890,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192 /* BindingElement */); + var node = createSynthesizedNode(191 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -70036,7 +69909,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -70050,7 +69923,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -70064,7 +69937,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -70072,10 +69945,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - // Not sure why this cast was necessary: the previous line should already establish that node.name is an identifier - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } // Because we are updating existed propertyAccess we want to inherit its emitFlags // instead of using the default from createPropertyAccess @@ -70086,7 +69957,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70107,7 +69978,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -70124,7 +69995,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70142,7 +70013,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -70161,7 +70032,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70181,7 +70052,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198 /* NewExpression */); + var node = createSynthesizedNode(197 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -70197,7 +70068,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -70220,7 +70091,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200 /* TypeAssertionExpression */); + var node = createSynthesizedNode(199 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -70234,7 +70105,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201 /* ParenthesizedExpression */); + var node = createSynthesizedNode(200 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -70246,7 +70117,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202 /* FunctionExpression */); + var node = createSynthesizedNode(201 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -70270,7 +70141,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203 /* ArrowFunction */); + var node = createSynthesizedNode(202 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -70292,7 +70163,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204 /* DeleteExpression */); + var node = createSynthesizedNode(203 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70304,7 +70175,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205 /* TypeOfExpression */); + var node = createSynthesizedNode(204 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70316,7 +70187,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206 /* VoidExpression */); + var node = createSynthesizedNode(205 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70328,7 +70199,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207 /* AwaitExpression */); + var node = createSynthesizedNode(206 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70340,7 +70211,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -70353,7 +70224,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -70366,7 +70237,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210 /* BinaryExpression */); + var node = createSynthesizedNode(209 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -70383,7 +70254,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211 /* ConditionalExpression */); + var node = createSynthesizedNode(210 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -70403,7 +70274,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212 /* TemplateExpression */); + var node = createSynthesizedNode(211 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70500,7 +70371,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213 /* YieldExpression */); + var node = createSynthesizedNode(212 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70514,7 +70385,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214 /* SpreadElement */); + var node = createSynthesizedNode(213 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70526,7 +70397,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215 /* ClassExpression */); + var node = createSynthesizedNode(214 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70547,11 +70418,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216 /* OmittedExpression */); + return createSynthesizedNode(215 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70565,7 +70436,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218 /* AsExpression */); + var node = createSynthesizedNode(217 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70579,19 +70450,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219 /* NonNullExpression */); + var node = createSynthesizedNode(218 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218 /* NonNullExpression */); + node.flags |= 32 /* OptionalChain */; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220 /* MetaProperty */); + var node = createSynthesizedNode(219 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70605,7 +70493,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222 /* TemplateSpan */); + var node = createSynthesizedNode(221 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70619,12 +70507,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223 /* SemicolonClassElement */); + return createSynthesizedNode(222 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224 /* Block */); + var block = createSynthesizedNode(223 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70638,7 +70526,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226 /* VariableStatement */); + var node = createSynthesizedNode(225 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70653,11 +70541,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225 /* EmptyStatement */); + return createSynthesizedNode(224 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227 /* ExpressionStatement */); + var node = createSynthesizedNode(226 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70673,7 +70561,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228 /* IfStatement */); + var node = createSynthesizedNode(227 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70689,7 +70577,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229 /* DoStatement */); + var node = createSynthesizedNode(228 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70703,7 +70591,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230 /* WhileStatement */); + var node = createSynthesizedNode(229 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70717,7 +70605,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231 /* ForStatement */); + var node = createSynthesizedNode(230 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70735,7 +70623,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForInStatement */); + var node = createSynthesizedNode(231 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70751,7 +70639,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233 /* ForOfStatement */); + var node = createSynthesizedNode(232 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70769,7 +70657,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234 /* ContinueStatement */); + var node = createSynthesizedNode(233 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70781,7 +70669,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235 /* BreakStatement */); + var node = createSynthesizedNode(234 /* BreakStatement */); node.label = asName(label); return node; } @@ -70793,7 +70681,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236 /* ReturnStatement */); + var node = createSynthesizedNode(235 /* ReturnStatement */); node.expression = expression; return node; } @@ -70805,7 +70693,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237 /* WithStatement */); + var node = createSynthesizedNode(236 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70819,7 +70707,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238 /* SwitchStatement */); + var node = createSynthesizedNode(237 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70833,7 +70721,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239 /* LabeledStatement */); + var node = createSynthesizedNode(238 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70847,7 +70735,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240 /* ThrowStatement */); + var node = createSynthesizedNode(239 /* ThrowStatement */); node.expression = expression; return node; } @@ -70859,7 +70747,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241 /* TryStatement */); + var node = createSynthesizedNode(240 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70875,12 +70763,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242 /* DebuggerStatement */); + return createSynthesizedNode(241 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70898,7 +70786,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70918,7 +70806,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* VariableDeclarationList */); + var node = createSynthesizedNode(243 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70931,7 +70819,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245 /* FunctionDeclaration */); + var node = createSynthesizedNode(244 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70957,7 +70845,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* ClassDeclaration */); + var node = createSynthesizedNode(245 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70979,7 +70867,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247 /* InterfaceDeclaration */); + var node = createSynthesizedNode(246 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71001,7 +70889,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71021,7 +70909,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249 /* EnumDeclaration */); + var node = createSynthesizedNode(248 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71040,7 +70928,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(250 /* ModuleDeclaration */); + var node = createSynthesizedNode(249 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -71059,7 +70947,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251 /* ModuleBlock */); + var node = createSynthesizedNode(250 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -71071,7 +70959,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252 /* CaseBlock */); + var node = createSynthesizedNode(251 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -71083,7 +70971,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -71095,7 +70983,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71113,7 +71001,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ImportDeclaration */); + var node = createSynthesizedNode(254 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -71132,7 +71020,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256 /* ImportClause */); + var node = createSynthesizedNode(255 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -71148,13 +71036,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257 /* NamespaceImport */); + var node = createSynthesizedNode(256 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263 /* NamespaceExport */); + var node = createSynthesizedNode(262 /* NamespaceExport */); node.name = name; return node; } @@ -71172,7 +71060,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258 /* NamedImports */); + var node = createSynthesizedNode(257 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -71184,7 +71072,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259 /* ImportSpecifier */); + var node = createSynthesizedNode(258 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -71198,7 +71086,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260 /* ExportAssignment */); + var node = createSynthesizedNode(259 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -71216,7 +71104,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261 /* ExportDeclaration */); + var node = createSynthesizedNode(260 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -71241,7 +71129,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262 /* NamedExports */); + var node = createSynthesizedNode(261 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -71253,7 +71141,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264 /* ExportSpecifier */); + var node = createSynthesizedNode(263 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -71268,7 +71156,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266 /* ExternalModuleReference */); + var node = createSynthesizedNode(265 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -71282,14 +71170,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295 /* JSDocTypeExpression */); + var node = createSynthesizedNode(294 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71297,7 +71185,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71305,14 +71193,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -71322,12 +71210,12 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocClassTag() { - return createJSDocTag(311 /* JSDocClassTag */, "class"); + return createJSDocTag(310 /* JSDocClassTag */, "class"); } ts.createJSDocClassTag = createJSDocClassTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304 /* JSDocComment */); + var node = createSynthesizedNode(303 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -71341,7 +71229,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267 /* JsxElement */); + var node = createSynthesizedNode(266 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -71357,7 +71245,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71373,7 +71261,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269 /* JsxOpeningElement */); + var node = createSynthesizedNode(268 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71389,7 +71277,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270 /* JsxClosingElement */); + var node = createSynthesizedNode(269 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -71401,7 +71289,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271 /* JsxFragment */); + var node = createSynthesizedNode(270 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -71423,11 +71311,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272 /* JsxOpeningFragment */); + return createSynthesizedNode(271 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273 /* JsxClosingFragment */); + return createSynthesizedNode(272 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71439,7 +71327,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274 /* JsxAttribute */); + var node = createSynthesizedNode(273 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71453,7 +71341,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275 /* JsxAttributes */); + var node = createSynthesizedNode(274 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71465,7 +71353,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71477,7 +71365,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277 /* JsxExpression */); + var node = createSynthesizedNode(276 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71491,7 +71379,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278 /* CaseClause */); + var node = createSynthesizedNode(277 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71505,7 +71393,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279 /* DefaultClause */); + var node = createSynthesizedNode(278 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71517,7 +71405,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280 /* HeritageClause */); + var node = createSynthesizedNode(279 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71530,7 +71418,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281 /* CatchClause */); + var node = createSynthesizedNode(280 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71545,7 +71433,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282 /* PropertyAssignment */); + var node = createSynthesizedNode(281 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71560,7 +71448,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71574,7 +71462,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284 /* SpreadAssignment */); + var node = createSynthesizedNode(283 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71587,7 +71475,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285 /* EnumMember */); + var node = createSynthesizedNode(284 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71608,7 +71496,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291 /* SourceFile */); + var updated = createSynthesizedNode(290 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71692,7 +71580,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326 /* NotEmittedStatement */); + var node = createSynthesizedNode(325 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71704,7 +71592,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71716,7 +71604,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71731,7 +71619,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71747,7 +71635,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328 /* CommaListExpression */) { + if (node.kind === 327 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71757,7 +71645,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328 /* CommaListExpression */); + var node = createSynthesizedNode(327 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71770,7 +71658,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71786,7 +71674,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292 /* Bundle */); + var node = ts.createNode(291 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71821,7 +71709,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293 /* UnparsedSource */); + var node = ts.createNode(292 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71956,10 +71844,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; - case "internal" /* Internal */: return 289 /* UnparsedInternalText */; - case "text" /* Text */: return 288 /* UnparsedText */; + case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; + case "internal" /* Internal */: return 288 /* UnparsedInternalText */; + case "text" /* Text */: return 287 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71977,14 +71865,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294 /* InputFiles */); + var node = ts.createNode(293 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -72181,7 +72069,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72728,7 +72616,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72747,13 +72635,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72761,7 +72649,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7 /* All */); + var callee = skipOuterExpressions(expression, 15 /* All */); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -72780,7 +72668,7 @@ var ts; } else { switch (callee.kind) { - case 195 /* PropertyAccessExpression */: { + case 194 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72793,7 +72681,7 @@ var ts; } break; } - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72853,14 +72741,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -73186,7 +73074,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 201 /* ParenthesizedExpression */) { + if (skipped.kind === 200 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -73220,10 +73108,10 @@ 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(210 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -73235,7 +73123,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 213 /* YieldExpression */) { + && operand.kind === 212 /* YieldExpression */) { return false; } return true; @@ -73323,7 +73211,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -73336,7 +73224,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -73371,8 +73259,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: needsParens = true; } } @@ -73388,9 +73276,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return ts.createParen(expression); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -73413,7 +73301,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73451,7 +73339,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73462,29 +73350,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { + if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); + return recreateOuterExpressions(expression, mutableCall, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { + if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73492,9 +73380,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173 /* TypeQuery */: - case 185 /* TypeOperator */: - case 182 /* InferType */: + case 172 /* TypeQuery */: + case 184 /* TypeOperator */: + case 181 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73520,28 +73408,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: node = node.operand; continue; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: node = node.left; continue; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: node = node.condition; continue; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: node = node.tag; continue; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 218 /* AsExpression */: - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: - case 219 /* NonNullExpression */: - case 327 /* PartiallyEmittedExpression */: + case 217 /* AsExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 218 /* NonNullExpression */: + case 326 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73550,71 +73438,61 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 328 /* CommaListExpression */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 327 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; (function (OuterExpressionKinds) { OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + OuterExpressionKinds[OuterExpressionKinds["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds[OuterExpressionKinds["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All"; })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 219 /* NonNullExpression */: - return (kinds & 2 /* Assertions */) !== 0; - case 327 /* PartiallyEmittedExpression */: - return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + return (kinds & 2 /* TypeAssertions */) !== 0; + case 218 /* NonNullExpression */: + return (kinds & 4 /* NonNullAssertions */) !== 0; + case 326 /* PartiallyEmittedExpression */: + return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = ts.skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { + if (kinds === void 0) { kinds = 15 /* All */; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6 /* Assertions */); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73632,7 +73510,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 201 /* ParenthesizedExpression */ + return node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73640,7 +73518,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -73750,10 +73628,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73872,7 +73750,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73884,11 +73762,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73920,12 +73798,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 156 /* Parameter */: + case 191 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 214 /* SpreadElement */: - case 284 /* SpreadAssignment */: + case 213 /* SpreadElement */: + case 283 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73943,7 +73821,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192 /* BindingElement */: + case 191 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73958,7 +73836,7 @@ var ts; : propertyName; } break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73973,7 +73851,7 @@ var ts; : propertyName; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73996,13 +73874,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -74042,11 +73920,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -74205,289 +74083,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158 /* Decorator */: + case 157 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163 /* Constructor */: + case 162 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176 /* TupleType */: + case 175 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* RestType */: + case 177 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* UnionType */: + case 178 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182 /* InferType */: + case 181 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187 /* MappedType */: + case 186 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 224 /* Block */: + case 223 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForStatement */: + case 230 /* ForStatement */: 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, ts.liftToBlock)); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74530,58 +74408,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { + if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 223 /* SemicolonClassElement */: - case 225 /* EmptyStatement */: - case 216 /* OmittedExpression */: - case 242 /* DebuggerStatement */: - case 326 /* NotEmittedStatement */: + case 222 /* SemicolonClassElement */: + case 224 /* EmptyStatement */: + case 215 /* OmittedExpression */: + case 241 /* DebuggerStatement */: + case 325 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 157 /* Parameter */: + case 156 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158 /* Decorator */: + case 157 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74590,12 +74468,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* Constructor */: + case 162 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74603,7 +74481,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74611,50 +74489,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* NewExpression */: + case 197 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74662,123 +74540,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201 /* ParenthesizedExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218 /* AsExpression */: + case 217 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 224 /* Block */: + case 223 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 230 /* WhileStatement */: - case 237 /* WithStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74787,7 +74665,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74795,143 +74673,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -75004,7 +74882,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75678,7 +75556,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75729,7 +75607,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75742,13 +75620,13 @@ var ts; hasImportDefault = true; } break; - case 254 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + case 253 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75779,13 +75657,13 @@ var ts; } } break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75793,7 +75671,7 @@ var ts; } } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75813,7 +75691,7 @@ var ts; } } break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75992,7 +75870,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 160 /* PropertyDeclaration */ + return member.kind === 159 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76621,8 +76499,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76648,14 +76526,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76706,16 +76584,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 251 /* ModuleBlock */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 250 /* ModuleBlock */: + case 223 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76727,7 +76605,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76770,10 +76648,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76794,13 +76672,13 @@ var ts; return node; } switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76820,11 +76698,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 261 /* ExportDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 256 /* ImportClause */ || - (node.kind === 254 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 266 /* ExternalModuleReference */)) { + if (node.kind === 260 /* ExportDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 255 /* ImportClause */ || + (node.kind === 253 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 265 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76848,19 +76726,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76896,62 +76774,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: - case 139 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 174 /* TypeLiteral */: - case 169 /* TypePredicate */: - case 156 /* TypeParameter */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 173 /* TypeLiteral */: + case 168 /* TypePredicate */: + case 155 /* TypeParameter */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 129 /* BooleanKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 128 /* BooleanKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 137 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 145 /* SymbolKeyword */: - case 172 /* ConstructorType */: - case 171 /* FunctionType */: - case 173 /* TypeQuery */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 183 /* ParenthesizedType */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: + case 144 /* SymbolKeyword */: + case 171 /* ConstructorType */: + case 170 /* FunctionType */: + case 172 /* TypeQuery */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 182 /* ParenthesizedType */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 158 /* Decorator */: + case 157 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76961,7 +76839,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76971,35 +76849,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -77009,35 +76887,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77450,12 +77328,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77608,7 +77486,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 160 /* PropertyDeclaration */ + ? member.kind === 159 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77731,10 +77609,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 160 /* PropertyDeclaration */; + return kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 159 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77744,7 +77622,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77755,12 +77633,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; } return false; @@ -77777,15 +77655,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: return serializeTypeNode(node.type); - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77822,7 +77700,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164 /* GetAccessor */) { + if (container && node.kind === 163 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77868,30 +77746,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return ts.createVoidZero(); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createIdentifier("Function"); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return ts.createIdentifier("Array"); - case 169 /* TypePredicate */: - case 129 /* BooleanKeyword */: + case 168 /* TypePredicate */: + case 128 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return ts.createIdentifier("String"); - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77902,34 +77780,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return serializeTypeReferenceNode(node); - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return serializeTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 185 /* TypeOperator */: - if (node.operator === 139 /* ReadonlyKeyword */) { + case 184 /* TypeOperator */: + if (node.operator === 138 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 173 /* TypeQuery */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 174 /* TypeLiteral */: + case 172 /* TypeQuery */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 173 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 184 /* ThisType */: - case 189 /* ImportType */: + case 148 /* UnknownKeyword */: + case 183 /* ThisType */: + case 188 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77942,13 +77820,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -78057,7 +77935,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78377,7 +78255,7 @@ var ts; /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2 /* Assertions */); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */); if (ts.isAssertionExpression(innerExpression)) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; @@ -78617,12 +78495,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 249 /* EnumDeclaration */) { + if (node.kind === 248 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78747,7 +78625,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251 /* ModuleBlock */) { + if (body.kind === 250 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78793,13 +78671,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 251 /* ModuleBlock */) { + if (body.kind !== 250 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78849,7 +78727,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 257 /* NamespaceImport */) { + if (node.kind === 256 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -79097,16 +78975,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(250 /* ModuleDeclaration */); + context.enableEmitNotification(249 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; } /** * Hook for node emit. @@ -79167,9 +79045,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -79207,9 +79085,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 291 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); + if (container && container.kind !== 290 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -79360,40 +79238,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return visitClassLike(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194 /* ObjectLiteralExpression */: - case 193 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -79416,20 +79294,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -80195,31 +80073,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80228,27 +80106,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 224 /* Block */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 237 /* WithStatement */: - case 239 /* LabeledStatement */: + case 223 /* Block */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 236 /* WithStatement */: + case 238 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80453,7 +80331,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203 /* ArrowFunction */; + var isArrowFunction = node.kind === 202 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80544,17 +80422,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -80602,11 +80480,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80638,11 +80516,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80810,64 +80688,64 @@ var ts; return node; } switch (node.kind) { - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitVoidExpression(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80901,7 +80779,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80913,7 +80791,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284 /* SpreadAssignment */) { + if (e.kind === 283 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80922,7 +80800,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80956,7 +80834,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -81334,17 +81212,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -81392,11 +81270,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -81428,11 +81306,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81530,7 +81408,7 @@ var ts; return node; } switch (node.kind) { - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81562,30 +81440,32 @@ var ts; return node; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -81616,7 +81496,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 /* PropertyAccessExpression */ + expression = node.kind === 194 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81630,10 +81510,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81652,8 +81532,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81663,11 +81543,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 /* PropertyAccessExpression */ + rightExpression = segment.kind === 194 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81765,13 +81645,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81781,13 +81661,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81862,7 +81742,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277 /* JsxExpression */) { + else if (node.kind === 276 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81956,7 +81836,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267 /* JsxElement */) { + if (node.kind === 266 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -82262,7 +82142,7 @@ var ts; return node; } switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82475,13 +82355,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 236 /* ReturnStatement */ + && node.kind === 235 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82503,63 +82383,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return visitClassExpression(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82570,28 +82450,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitMetaProperty(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82682,14 +82562,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82700,7 +82580,7 @@ var ts; } } else { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -83096,11 +82976,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 236 /* ReturnStatement */) { + if (statement.kind === 235 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 228 /* IfStatement */) { + else if (statement.kind === 227 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -83108,7 +82988,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 224 /* Block */) { + else if (statement.kind === 223 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -83306,7 +83186,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -83327,22 +83207,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return statements; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -83374,20 +83254,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83589,7 +83469,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83633,7 +83513,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203 /* ArrowFunction */); + ts.Debug.assert(node.kind === 202 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83701,9 +83581,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83722,9 +83602,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83938,14 +83818,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -84133,7 +84013,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155 /* ComputedPropertyName */) { + if (property.name.kind === 154 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -84254,11 +84134,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -84283,11 +84163,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84686,20 +84566,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84806,7 +84686,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -85298,13 +85178,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(163 /* Constructor */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(203 /* ArrowFunction */); - context.enableEmitNotification(202 /* FunctionExpression */); - context.enableEmitNotification(245 /* FunctionDeclaration */); + context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(202 /* ArrowFunction */); + context.enableEmitNotification(201 /* FunctionExpression */); + context.enableEmitNotification(244 /* FunctionDeclaration */); } } /** @@ -85345,10 +85225,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 242 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -85430,11 +85310,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85442,7 +85322,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85482,15 +85362,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269 /* JsxOpeningElement */); - context.enableEmitNotification(270 /* JsxClosingElement */); - context.enableEmitNotification(268 /* JsxSelfClosingElement */); + context.enableEmitNotification(268 /* JsxOpeningElement */); + context.enableEmitNotification(269 /* JsxClosingElement */); + context.enableEmitNotification(267 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(282 /* PropertyAssignment */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(281 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85509,9 +85389,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85846,13 +85726,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85865,24 +85745,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return visitBreakStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return visitContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85903,21 +85783,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitConditionalExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85930,9 +85810,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -86140,7 +86020,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -86152,7 +86032,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86528,35 +86408,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: return transformAndEmitBlock(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return transformAndEmitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return transformAndEmitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return transformAndEmitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return transformAndEmitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86986,7 +86866,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86999,7 +86879,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -88228,11 +88108,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88556,23 +88436,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88599,24 +88479,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -89116,7 +88996,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -89171,10 +89051,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -89387,7 +89267,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89451,10 +89331,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89475,7 +89355,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89550,7 +89430,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89649,12 +89529,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89878,7 +89758,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89903,7 +89783,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261 /* ExportDeclaration */) { + if (externalImport.kind !== 260 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89986,19 +89866,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -90057,13 +89937,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -90243,7 +90123,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -90307,7 +90187,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -90369,10 +90249,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90552,43 +90432,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitDefaultClause(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitTryStatement(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90835,7 +90715,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291 /* SourceFile */; + return container !== undefined && container.kind === 290 /* SourceFile */; } else { return false; @@ -90868,7 +90748,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90918,7 +90798,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90954,12 +90834,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -91052,14 +90932,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209 /* PostfixUnaryExpression */) { + if (node.kind === 208 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -91087,7 +90967,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -91126,7 +91006,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291 /* SourceFile */); + context.enableEmitNotification(290 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -91151,12 +91031,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -91287,7 +91167,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91316,7 +91196,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91363,7 +91243,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91372,8 +91252,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || - (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || + (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -91382,7 +91262,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 === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { + else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91407,7 +91287,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91446,26 +91326,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have return types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have return types that cannot be named 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 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91473,7 +91353,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91487,7 +91367,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91512,30 +91392,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 167 /* ConstructSignature */: - case 172 /* ConstructorType */: + case 166 /* ConstructSignature */: + case 171 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91543,7 +91423,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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91556,15 +91436,15 @@ 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 245 /* FunctionDeclaration */: - case 171 /* FunctionType */: + case 244 /* FunctionDeclaration */: + case 170 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91578,39 +91458,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187 /* MappedType */: + case 186 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { 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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { 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 171 /* FunctionType */: - case 245 /* FunctionDeclaration */: + case 170 /* FunctionType */: + case 244 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91625,7 +91505,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 246 /* ClassDeclaration */) { + if (node.parent.parent.kind === 245 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91676,7 +91556,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91835,10 +91715,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91861,14 +91741,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -92009,7 +91889,7 @@ var ts; return name; } else { - if (name.kind === 191 /* ArrayBindingPattern */) { + if (name.kind === 190 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -92017,7 +91897,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216 /* OmittedExpression */) { + if (elem.kind === 215 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -92055,7 +91935,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 157 /* Parameter */ && + var shouldUseResolverType = node.kind === 156 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -92064,7 +91944,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -92075,12 +91955,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 /* Parameter */ - || node.kind === 160 /* PropertyDeclaration */ - || node.kind === 159 /* PropertySignature */) { + if (node.kind === 156 /* Parameter */ + || node.kind === 159 /* PropertyDeclaration */ + || node.kind === 158 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -92097,20 +91977,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return false; } return false; @@ -92191,7 +92071,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -92211,7 +92091,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -92238,7 +92118,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -92327,7 +92207,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -92348,38 +92228,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217 /* ExpressionWithTypeArguments */: { + case 216 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170 /* TypeReference */: { + case 169 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163 /* Constructor */: { + case 162 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162 /* MethodDeclaration */: { + case 161 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164 /* GetAccessor */: { + case 163 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92388,7 +92268,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 165 /* SetAccessor */: { + case 164 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92396,31 +92276,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161 /* MethodSignature */: { + case 160 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166 /* CallSignature */: { + case 165 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168 /* IndexSignature */: { + case 167 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -92428,13 +92308,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156 /* TypeParameter */: { + case 155 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181 /* ConditionalType */: { + case 180 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92446,13 +92326,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171 /* FunctionType */: { + case 170 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172 /* ConstructorType */: { + case 171 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189 /* ImportType */: { + case 188 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92481,7 +92361,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92491,7 +92371,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261 /* ExportDeclaration */: { + case 260 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92501,7 +92381,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92517,7 +92397,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92542,10 +92422,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92566,14 +92446,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247 /* InterfaceDeclaration */: { + case 246 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245 /* FunctionDeclaration */: { + case 244 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92621,10 +92501,10 @@ var ts; return clean; } } - case 250 /* ModuleDeclaration */: { + case 249 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251 /* ModuleBlock */) { + if (inner && inner.kind === 250 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92667,7 +92547,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 246 /* ClassDeclaration */: { + case 245 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92728,7 +92608,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92748,10 +92628,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 249 /* EnumDeclaration */: { + case 248 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92770,7 +92650,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250 /* ModuleDeclaration */) { + if (input.kind === 249 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92791,7 +92671,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216 /* OmittedExpression */) { + if (e.kind === 215 /* OmittedExpression */) { return; } if (e.name) { @@ -92841,7 +92721,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 291 /* SourceFile */; + var parentIsFile = node.parent.kind === 290 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92870,7 +92750,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { return true; } return false; @@ -92895,7 +92775,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 /* GetAccessor */ + return accessor.kind === 163 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92904,52 +92784,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 226 /* VariableStatement */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 225 /* VariableStatement */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 243 /* VariableDeclaration */: - case 156 /* TypeParameter */: - case 217 /* ExpressionWithTypeArguments */: - case 170 /* TypeReference */: - case 181 /* ConditionalType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 189 /* ImportType */: + case 166 /* ConstructSignature */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 242 /* VariableDeclaration */: + case 155 /* TypeParameter */: + case 216 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 180 /* ConditionalType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 188 /* ImportType */: return true; } return false; @@ -93082,7 +92962,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332 /* Count */); + var enabledSyntaxKindFeatures = new Array(331 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93446,7 +93326,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292 /* Bundle */) { + if (sourceFile.kind === 291 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93776,7 +93656,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93799,8 +93679,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93841,7 +93721,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93952,7 +93832,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93964,7 +93844,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -94142,9 +94022,9 @@ var ts; break; } switch (node.kind) { - case 291 /* SourceFile */: return printFile(node); - case 292 /* Bundle */: return printBundle(node); - case 293 /* UnparsedSource */: return printUnparsedSource(node); + case 290 /* SourceFile */: return printFile(node); + case 291 /* Bundle */: return printBundle(node); + case 292 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -94400,12 +94280,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94447,15 +94327,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 293 /* UnparsedSource */: - case 287 /* UnparsedPrepend */: + case 292 /* UnparsedSource */: + case 286 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 286 /* UnparsedPrologue */: + case 285 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 290 /* UnparsedSyntheticReference */: + case 289 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94465,260 +94345,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return emitQualifiedName(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return emitTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return emitParameter(node); - case 158 /* Decorator */: + case 157 /* Decorator */: return emitDecorator(node); // Type members - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return emitPropertySignature(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return emitMethodSignature(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return emitConstructor(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return emitAccessorDeclaration(node); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return emitCallSignature(node); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return emitConstructSignature(node); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return emitIndexSignature(node); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return emitTypePredicate(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return emitTypeReference(node); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return emitFunctionType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return emitConstructorType(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return emitTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return emitTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return emitArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return emitTupleType(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return emitOptionalType(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return emitUnionType(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return emitIntersectionType(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return emitConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return emitInferType(node); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return emitParenthesizedType(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return emitThisType(); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return emitTypeOperator(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return emitMappedType(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return emitLiteralType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return emitImportTypeNode(node); - case 296 /* JSDocAllType */: + case 295 /* JSDocAllType */: writePunctuation("*"); return; - case 297 /* JSDocUnknownType */: + case 296 /* JSDocUnknownType */: writePunctuation("?"); return; - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 178 /* RestType */: - case 302 /* JSDocVariadicType */: + case 177 /* RestType */: + case 301 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return emitBindingElement(node); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return emitTemplateSpan(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 224 /* Block */: + case 223 /* Block */: return emitBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return emitVariableStatement(node); - case 225 /* EmptyStatement */: + case 224 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return emitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return emitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return emitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return emitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return emitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return emitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return emitForOfStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return emitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return emitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return emitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return emitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return emitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return emitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return emitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return emitTryStatement(node); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return emitClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return emitModuleBlock(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return emitCaseBlock(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return emitImportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return emitImportClause(node); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return emitNamespaceImport(node); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return emitNamespaceExport(node); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return emitNamedImports(node); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return emitImportSpecifier(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return emitExportDeclaration(node); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return emitNamedExports(node); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return emitExportSpecifier(node); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 270 /* JsxClosingElement */: - case 273 /* JsxClosingFragment */: + case 269 /* JsxClosingElement */: + case 272 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return emitJsxAttribute(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return emitJsxAttributes(node); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return emitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return emitDefaultClause(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return emitHeritageClause(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 309 /* JSDocImplementsTag */: - case 308 /* JSDocAugmentsTag */: + case 308 /* JSDocImplementsTag */: + case 307 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return emitJSDocSignature(node); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 311 /* JSDocClassTag */: - case 307 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 306 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94755,71 +94635,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return emitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return emitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return emitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return emitArrowFunction(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return emitDeleteExpression(node); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return emitVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return emitAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return emitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return emitConditionalExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return emitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return emitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return emitSpreadExpression(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return emitClassExpression(node); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return; - case 218 /* AsExpression */: + case 217 /* AsExpression */: return emitAsExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return emitNonNullExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return emitJsxElement(node); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return emitCommaList(node); } } @@ -94861,7 +94741,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 /* Bundle */ ? node : undefined; + var bundle = node.kind === 291 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94961,7 +94841,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -95034,7 +94914,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -95096,7 +94976,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -95279,7 +95159,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -95513,7 +95393,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 208 /* PrefixUnaryExpression */ + return operand.kind === 207 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95701,7 +95581,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228 /* IfStatement */) { + if (node.elseStatement.kind === 227 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95764,7 +95644,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95772,7 +95652,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { emit(node); } else { @@ -96068,7 +95948,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250 /* ModuleDeclaration */) { + while (body.kind === 249 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -96113,7 +95993,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -96121,7 +96001,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -96161,7 +96041,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -96173,7 +96053,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -96184,7 +96064,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -96404,7 +96284,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -96438,7 +96318,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96457,7 +96337,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -97277,7 +97157,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -97342,84 +97222,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: ts.forEach(node.statements, generateNames); break; - case 239 /* LabeledStatement */: - case 237 /* WithStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 238 /* LabeledStatement */: + case 236 /* WithStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: generateNames(node.statement); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: generateNames(node.declarationList); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: generateNames(node.importClause); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -97428,12 +97308,12 @@ var ts; if (!node) return; switch (node.kind) { - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97615,23 +97495,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 259 /* ExportAssignment */: return generateNameForExportDefault(); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return generateNameForClassExpression(); - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97679,7 +97559,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97703,7 +97583,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97962,7 +97842,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97975,7 +97855,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -100001,22 +99881,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 243 /* VariableDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 242 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -100024,58 +99904,58 @@ var ts; } } switch (node.kind) { - case 256 /* ImportClause */: + case 255 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); + case 249 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218 /* AsExpression */: + case 217 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -100084,29 +99964,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); return "skip"; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -100118,19 +99998,19 @@ var ts; return "skip"; } break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: - case 199 /* TaggedTemplateExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 198 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -100152,8 +100032,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: - case 131 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -106821,37 +106701,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 281 /* CatchClause */: - case 274 /* JsxAttribute */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 280 /* CatchClause */: + case 273 /* JsxAttribute */: return 1 /* Value */; - case 156 /* TypeParameter */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 174 /* TypeLiteral */: + case 155 /* TypeParameter */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 173 /* TypeLiteral */: return 2 /* Type */; - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 285 /* EnumMember */: - case 246 /* ClassDeclaration */: + case 284 /* EnumMember */: + case 245 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -106861,16 +106741,16 @@ var ts; else { return 4 /* Namespace */; } - case 249 /* EnumDeclaration */: - case 258 /* NamedImports */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 248 /* EnumDeclaration */: + case 257 /* NamedImports */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -106878,10 +106758,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { + else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -106913,11 +106793,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -106929,27 +106809,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 154 /* QualifiedName */) { - while (root.parent && root.parent.kind === 154 /* QualifiedName */) { + if (root.parent.kind === 153 /* QualifiedName */) { + while (root.parent && root.parent.kind === 153 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 170 /* TypeReference */ && !isLastClause; + return root.parent.kind === 169 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 195 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { + if (root.parent.kind === 194 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -106960,15 +106840,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return true; } switch (node.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return true; - case 189 /* ImportType */: + case 188 /* ImportType */: return !node.parent.isTypeOf; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -107035,7 +106915,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -107096,22 +106976,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 250 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 249 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return true; - case 188 /* LiteralType */: - return node.parent.parent.kind === 186 /* IndexedAccessType */; + case 187 /* LiteralType */: + return node.parent.parent.kind === 185 /* IndexedAccessType */; default: return false; } @@ -107135,17 +107015,17 @@ var ts; return undefined; } switch (node.kind) { - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return node; } } @@ -107153,54 +107033,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return "class" /* classElement */; - case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 248 /* TypeAliasDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 247 /* TypeAliasDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 249 /* EnumDeclaration */: return "enum" /* enumElement */; - case 243 /* VariableDeclaration */: + case 248 /* EnumDeclaration */: return "enum" /* enumElement */; + case 242 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return "function" /* functionElement */; - case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 166 /* CallSignature */: return "call" /* callSignatureElement */; - case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: + case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 165 /* CallSignature */: return "call" /* callSignatureElement */; + case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: return "alias" /* alias */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -107229,7 +107109,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -107252,7 +107132,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; default: return false; } @@ -107317,42 +107197,42 @@ var ts; return false; } switch (n.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 190 /* ObjectBindingPattern */: - case 174 /* TypeLiteral */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 252 /* CaseBlock */: - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 173 /* TypeLiteral */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 251 /* CaseBlock */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 198 /* NewExpression */: + case 197 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 197 /* CallExpression */: - case 201 /* ParenthesizedExpression */: - case 183 /* ParenthesizedType */: + case 196 /* CallExpression */: + case 200 /* ParenthesizedExpression */: + case 182 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 202 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107362,65 +107242,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 193 /* ArrayLiteralExpression */: - case 191 /* ArrayBindingPattern */: - case 196 /* ElementAccessExpression */: - case 155 /* ComputedPropertyName */: - case 176 /* TupleType */: + case 192 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 195 /* ElementAccessExpression */: + case 154 /* ComputedPropertyName */: + case 175 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 205 /* TypeOfExpression */: - case 204 /* DeleteExpression */: - case 206 /* VoidExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: + case 204 /* TypeOfExpression */: + case 203 /* DeleteExpression */: + case 205 /* VoidExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -107527,11 +107407,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -107626,11 +107506,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -107644,7 +107524,7 @@ var ts; return decl.name; } } - if (node.kind === 146 /* TypeKeyword */) { + if (node.kind === 145 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -107711,12 +107591,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -107741,7 +107621,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -107749,12 +107629,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && + if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && + if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -107791,7 +107671,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -107932,7 +107812,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -108002,17 +107882,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { return true; } return false; @@ -108077,7 +107957,7 @@ var ts; function getPossibleGenericSignatures(called, typeArgumentCount, checker) { var type = checker.getTypeAtLocation(called); if (ts.isOptionalChain(called.parent)) { - type = removeOptionality(type, !!called.parent.questionDotToken, /*isOptionalChain*/ true); + type = removeOptionality(type, ts.isOptionalChainRoot(called.parent), /*isOptionalChain*/ true); } var signatures = ts.isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); return signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; }); @@ -108153,7 +108033,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -108208,16 +108088,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 260 /* ExportAssignment */) + if (node.kind === 259 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { + if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -108262,18 +108142,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 193 /* ArrayLiteralExpression */ || - node.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 192 /* ArrayLiteralExpression */ || + node.kind === 193 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 210 /* BinaryExpression */ && + if (node.parent.kind === 209 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 233 /* ForOfStatement */ && + if (node.parent.kind === 232 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -108281,7 +108161,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -108327,29 +108207,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 152 /* BigIntKeyword */, - 129 /* BooleanKeyword */, + 151 /* BigIntKeyword */, + 128 /* BooleanKeyword */, 91 /* FalseKeyword */, - 135 /* KeyOfKeyword */, - 138 /* NeverKeyword */, + 134 /* KeyOfKeyword */, + 137 /* NeverKeyword */, 100 /* NullKeyword */, - 141 /* NumberKeyword */, - 142 /* ObjectKeyword */, - 139 /* ReadonlyKeyword */, - 144 /* StringKeyword */, - 145 /* SymbolKeyword */, + 140 /* NumberKeyword */, + 141 /* ObjectKeyword */, + 138 /* ReadonlyKeyword */, + 143 /* StringKeyword */, + 144 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 147 /* UndefinedKeyword */, - 148 /* UniqueKeyword */, - 149 /* UnknownKeyword */, + 146 /* UndefinedKeyword */, + 147 /* UniqueKeyword */, + 148 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 146 /* TypeKeyword */; + return node.kind === 145 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108382,7 +108262,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 155 /* ComputedPropertyName */ + return name.kind === 154 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -108542,7 +108422,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -108588,7 +108468,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -109052,15 +108932,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checker.getContextualType(parent); - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 278 /* CaseClause */: + case 277 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -109099,8 +108979,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 199 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: return true; default: return false; @@ -109133,41 +109013,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 166 /* CallSignature */ - || kind === 167 /* ConstructSignature */ - || kind === 168 /* IndexSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */; + return kind === 165 /* CallSignature */ + || kind === 166 /* ConstructSignature */ + || kind === 167 /* IndexSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 244 /* FunctionDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 250 /* ModuleDeclaration */; + return kind === 249 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 226 /* VariableStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 229 /* DoStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 235 /* BreakStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 160 /* PropertyDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 260 /* ExportAssignment */; + return kind === 225 /* VariableStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 228 /* DoStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 234 /* BreakStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 159 /* PropertyDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 259 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -109197,7 +109077,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 229 /* DoStatement */) { + if (node.kind === 228 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -109564,10 +109444,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -109756,9 +109636,9 @@ var ts; return true; } switch (keyword2) { - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - case 130 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + case 129 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -109899,10 +109779,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -110122,18 +110002,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -110284,22 +110164,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -110328,17 +110208,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 243 /* VariableDeclaration */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 157 /* Parameter */ || - parent.kind === 274 /* JsxAttribute */) { + if (parent.kind === 242 /* VariableDeclaration */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 156 /* Parameter */ || + parent.kind === 273 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 210 /* BinaryExpression */ || - parent.kind === 208 /* PrefixUnaryExpression */ || - parent.kind === 209 /* PostfixUnaryExpression */ || - parent.kind === 211 /* ConditionalExpression */) { + if (parent.kind === 209 /* BinaryExpression */ || + parent.kind === 207 /* PrefixUnaryExpression */ || + parent.kind === 208 /* PostfixUnaryExpression */ || + parent.kind === 210 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110351,7 +110231,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110367,32 +110247,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 157 /* Parameter */: + case 156 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -110516,11 +110396,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (parent.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -110528,9 +110408,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 189 /* ImportType */: + case 188 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 179 /* UnionType */: { + case 178 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -110540,7 +110420,7 @@ var ts; default: return undefined; } - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -110557,7 +110437,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -110570,8 +110450,8 @@ var ts; } return undefined; } - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -110580,9 +110460,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 266 /* ExternalModuleReference */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 265 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -111533,11 +111413,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -111547,7 +111427,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -111566,7 +111446,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -111617,11 +111497,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -111673,7 +111553,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -111685,14 +111565,14 @@ var ts; return undefined; } break; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: node = parent.left; break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: node = parent.name; break; - case 189 /* ImportType */: - case 220 /* MetaProperty */: + case 188 /* ImportType */: + case 219 /* MetaProperty */: node = parent; break; default: @@ -111705,7 +111585,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 195 /* PropertyAccessExpression */) { + if (parent && parent.kind === 194 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -111713,38 +111593,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: + case 268 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -111824,11 +111704,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 323 /* JSDocTypedefTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 322 /* JSDocTypedefTag */: return true; default: return false; @@ -111873,7 +111753,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -111920,7 +111800,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -112076,7 +111956,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -112126,10 +112006,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 291 /* SourceFile */: - case 212 /* TemplateExpression */: - case 277 /* JsxExpression */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 211 /* TemplateExpression */: + case 276 /* JsxExpression */: + case 223 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -112175,27 +112055,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 160 /* PropertyDeclaration */ || - parentKind === 159 /* PropertySignature */ || - parentKind === 157 /* Parameter */ || - parentKind === 243 /* VariableDeclaration */ || + return parentKind === 159 /* PropertyDeclaration */ || + parentKind === 158 /* PropertySignature */ || + parentKind === 156 /* Parameter */ || + parentKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 248 /* TypeAliasDeclaration */; + return parentKind === 247 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 218 /* AsExpression */; + return parentKind === 217 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 170 /* TypeReference */ || - parentKind === 200 /* TypeAssertionExpression */; + return parentKind === 169 /* TypeReference */ || + parentKind === 199 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 156 /* TypeParameter */; + return parentKind === 155 /* TypeParameter */; } } return false; @@ -112406,7 +112286,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112416,10 +112296,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 269 /* JsxOpeningElement */; + return location.parent.kind !== 268 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; + if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; } } return false; @@ -112430,40 +112310,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 197 /* CallExpression */ // func( a, | - || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 198 /* NewExpression */ // new C(a, | - || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 196 /* CallExpression */ // func( a, | + || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 197 /* NewExpression */ // new C(a, | + || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 197 /* CallExpression */ // func( | - || containingNodeKind === 163 /* Constructor */ // constructor( | - || containingNodeKind === 198 /* NewExpression */ // new C(a| - || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 196 /* CallExpression */ // func( | + || containingNodeKind === 162 /* Constructor */ // constructor( | + || containingNodeKind === 197 /* NewExpression */ // new C(a| + || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 136 /* ModuleKeyword */: // module | - case 137 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 135 /* ModuleKeyword */: // module | + case 136 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 210 /* BinaryExpression */; // x = a| + return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 209 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -112490,7 +112370,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -112500,7 +112380,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -112511,12 +112391,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -112566,7 +112446,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -112688,11 +112568,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: - case 275 /* JsxAttributes */: - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { + case 194 /* PropertyAccessExpression */: + case 274 /* JsxAttributes */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -112700,7 +112580,7 @@ var ts; } return parent; } - else if (parent.kind === 274 /* JsxAttribute */) { + else if (parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112712,7 +112592,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112722,8 +112602,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 277 /* JsxExpression */ && - parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { + parent.kind === 276 /* JsxExpression */ && + parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112731,7 +112611,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -112751,51 +112631,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 243 /* VariableDeclaration */ || + return containingNodeKind === 242 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 226 /* VariableStatement */ || - containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 225 /* VariableStatement */ || + containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 192 /* BindingElement */; // var {x :html| + return containingNodeKind === 191 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 281 /* CatchClause */ || + return containingNodeKind === 280 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | - containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | + containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 157 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 156 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 259 /* ImportSpecifier */ || - containingNodeKind === 264 /* ExportSpecifier */ || - containingNodeKind === 257 /* NamespaceImport */; - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + return containingNodeKind === 258 /* ImportSpecifier */ || + containingNodeKind === 263 /* ExportSpecifier */ || + containingNodeKind === 256 /* NamespaceImport */; + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -112806,7 +112686,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 146 /* TypeKeyword */: // type htm| + case 145 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -112832,7 +112712,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -112854,7 +112734,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -112864,7 +112744,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ + return node.parent.kind === 243 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -112882,13 +112762,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 282 /* PropertyAssignment */ && - m.kind !== 283 /* ShorthandPropertyAssignment */ && - m.kind !== 192 /* BindingElement */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */ && - m.kind !== 284 /* SpreadAssignment */) { + if (m.kind !== 281 /* PropertyAssignment */ && + m.kind !== 282 /* ShorthandPropertyAssignment */ && + m.kind !== 191 /* BindingElement */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */ && + m.kind !== 283 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -112959,10 +112839,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 160 /* PropertyDeclaration */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */) { + if (m.kind !== 159 /* PropertyDeclaration */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113003,7 +112883,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 274 /* JsxAttribute */) { + if (attr.kind === 273 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -113053,7 +112933,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -113079,12 +112959,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 131 /* DeclareKeyword */ - || kind === 136 /* ModuleKeyword */ - || kind === 146 /* TypeKeyword */ - || kind === 137 /* NamespaceKeyword */ + || kind === 130 /* DeclareKeyword */ + || kind === 135 /* ModuleKeyword */ + || kind === 145 /* TypeKeyword */ + || kind === 136 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -113106,46 +112986,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 131 /* DeclareKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 134 /* IsKeyword */: - case 135 /* KeyOfKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 138 /* NeverKeyword */: - case 141 /* NumberKeyword */: - case 142 /* ObjectKeyword */: + case 133 /* IsKeyword */: + case 134 /* KeyOfKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 137 /* NeverKeyword */: + case 140 /* NumberKeyword */: + case 141 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: - case 144 /* StringKeyword */: - case 145 /* SymbolKeyword */: - case 146 /* TypeKeyword */: - case 148 /* UniqueKeyword */: - case 149 /* UnknownKeyword */: + case 138 /* ReadonlyKeyword */: + case 143 /* StringKeyword */: + case 144 /* SymbolKeyword */: + case 145 /* TypeKeyword */: + case 147 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 139 /* ReadonlyKeyword */; + return kind === 138 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 130 /* ConstructorKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 129 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -113204,7 +113084,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 325 /* SyntaxList */: + case 324 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113372,11 +113252,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 130 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); + case 129 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113424,7 +113304,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113456,16 +113336,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 238 /* SwitchStatement */: - if (statement.kind === 234 /* ContinueStatement */) { + case 237 /* SwitchStatement */: + if (statement.kind === 233 /* ContinueStatement */) { return false; } // falls through - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -113481,11 +113361,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 224 /* Block */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 223 /* Block */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -113493,14 +113373,14 @@ var ts; else { return container.statements; } - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 173 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -113533,7 +113413,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 229 /* DoStatement */) { + if (loopNode.kind === 228 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -113553,13 +113433,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -113926,10 +113806,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -113942,20 +113822,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -113965,7 +113845,7 @@ var ts; directImports.push(direct); } break; - case 189 /* ImportType */: + case 188 /* ImportType */: directImports.push(direct); break; default: @@ -113982,7 +113862,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -114039,7 +113919,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 254 /* ImportEqualsDeclaration */) { + if (decl.kind === 253 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -114049,7 +113929,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 189 /* ImportType */) { + if (decl.kind === 188 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -114065,7 +113945,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 261 /* ExportDeclaration */) { + if (decl.kind === 260 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -114074,10 +113954,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -114127,7 +114007,7 @@ var ts; } } else { - var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -114156,7 +114036,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 291 /* SourceFile */) { + if (searchSourceFile.kind === 290 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -114204,7 +114084,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -114219,15 +114099,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: { + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -114251,7 +114131,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 195 /* PropertyAccessExpression */) { + if (parent.kind === 194 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114381,13 +114261,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114420,21 +114300,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 291 /* SourceFile */) { + if (parent.kind === 290 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -114536,7 +114416,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -114544,27 +114424,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextNode(node.parent.parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -114625,13 +114505,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -114781,13 +114661,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 215 /* ClassExpression */) { + else if (node.kind === 214 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -114837,7 +114717,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -114848,47 +114728,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 210 /* BinaryExpression */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 209 /* BinaryExpression */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 264 /* ExportSpecifier */: - case 256 /* ImportClause */: // default import - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 247 /* InterfaceDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 274 /* JsxAttribute */: - case 250 /* ModuleDeclaration */: - case 253 /* NamespaceExportDeclaration */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: - case 157 /* Parameter */: - case 283 /* ShorthandPropertyAssignment */: - case 248 /* TypeAliasDeclaration */: - case 156 /* TypeParameter */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 263 /* ExportSpecifier */: + case 255 /* ImportClause */: // default import + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 246 /* InterfaceDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 273 /* JsxAttribute */: + case 249 /* ModuleDeclaration */: + case 252 /* NamespaceExportDeclaration */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: + case 156 /* Parameter */: + case 282 /* ShorthandPropertyAssignment */: + case 247 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: return true; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return !!decl.body; - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 161 /* MethodSignature */: - case 159 /* PropertySignature */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 160 /* MethodSignature */: + case 158 /* PropertySignature */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -115049,10 +114929,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -115081,9 +114961,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 139 /* ReadonlyKeyword */ + return node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 139 /* ReadonlyKeyword */; + && node.parent.operator === 138 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -115094,12 +114974,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -115160,7 +115040,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115400,7 +115280,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115410,7 +115290,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115439,7 +115319,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -115810,15 +115690,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 162 /* MethodDeclaration */) { + if (decl && decl.kind === 161 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -115842,7 +115722,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 163 /* Constructor */); + ts.Debug.assert(decl.kind === 162 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -115872,7 +115752,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -115892,7 +115772,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 224 /* Block */) { + if (body.kind === 223 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -115920,13 +115800,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 193 /* ArrayLiteralExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 192 /* ArrayLiteralExpression */: return true; default: return false; @@ -115979,13 +115859,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -116006,41 +115886,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -116048,19 +115928,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 291 /* SourceFile */: - return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 290 /* SourceFile */: + return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -116143,7 +116023,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -116188,7 +116068,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -116584,55 +116464,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 197 /* CallExpression */: + case 196 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* NewExpression */: + case 197 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 158 /* Decorator */: + case 157 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -116682,22 +116562,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -116994,7 +116874,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -117163,11 +117043,11 @@ var ts; return true; } switch (declaration.kind) { - case 256 /* ImportClause */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: return true; - case 259 /* ImportSpecifier */: - return declaration.parent.kind === 258 /* NamedImports */; + case 258 /* ImportSpecifier */: + return declaration.parent.kind === 257 /* NamedImports */; default: return false; } @@ -117181,7 +117061,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -117254,9 +117134,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return true; default: return false; @@ -117374,11 +117254,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return [declaration]; - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117399,18 +117279,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return withNode(tag.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return withNode(tag.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -117579,23 +117459,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 160 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 159 /* PropertySignature */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 158 /* PropertySignature */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 247 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -117603,14 +117483,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 291 /* SourceFile */: + case 290 /* SourceFile */: return "quit"; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 210 /* BinaryExpression */: { + return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 209 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -117618,7 +117498,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -117634,14 +117514,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return rightHandSide.parameters; - case 215 /* ClassExpression */: { + case 214 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -117703,9 +117583,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -117715,7 +117595,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -117732,7 +117612,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -117939,7 +117819,7 @@ var ts; return; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -117951,21 +117831,21 @@ var ts; } } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 160 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -117977,7 +117857,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -117988,17 +117868,17 @@ var ts; } } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: + case 242 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -118013,7 +117893,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -118021,11 +117901,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -118035,9 +117915,9 @@ var ts; } endNode(); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -118045,20 +117925,20 @@ var ts; } endNode(); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 260 /* ExportAssignment */: - case 264 /* ExportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 168 /* IndexSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 248 /* TypeAliasDeclaration */: + case 259 /* ExportAssignment */: + case 263 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 167 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 247 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -118300,12 +118180,12 @@ var ts; return false; } switch (a.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -118321,7 +118201,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118351,7 +118231,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118360,16 +118240,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118381,18 +118261,18 @@ var ts; } } switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118400,13 +118280,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return "new()"; - case 166 /* CallSignature */: + case 165 /* CallSignature */: return "()"; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "[]"; default: return ""; @@ -118439,19 +118319,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 291 /* SourceFile */: - case 248 /* TypeAliasDeclaration */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 247 /* TypeAliasDeclaration */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: return true; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118461,10 +118341,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: return true; default: return false; @@ -118524,7 +118404,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -118538,13 +118418,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 155 /* ComputedPropertyName */; + return !member.name || member.name.kind === 154 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -118602,9 +118482,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: return true; default: return false; @@ -119112,7 +118992,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -119120,16 +119000,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 229 /* DoStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 281 /* CatchClause */: + case 228 /* DoStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 280 /* CatchClause */: return spanForNode(n.parent); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -119146,29 +119026,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanForNode(n.parent); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 252 /* CaseBlock */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 251 /* CaseBlock */: return spanForNode(n); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return spanForNodeArray(n.statements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return spanForJSXElement(n); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return spanForJSXFragment(n); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -119220,7 +119100,7 @@ var ts; ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -119755,10 +119635,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 131 /* DeclareKeyword */) { + if (token === 130 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 136 /* ModuleKeyword */) { + if (token === 135 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -119794,7 +119674,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -119825,7 +119705,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -119841,7 +119721,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -119871,7 +119751,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -119883,7 +119763,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -119909,7 +119789,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 140 /* RequireKeyword */) { + if (token === 139 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -120070,7 +119950,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -120282,14 +120162,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 156 /* TypeParameter */ || + kind === 155 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120396,7 +120276,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120405,14 +120285,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 269 /* JsxOpeningElement */; + || kind === 268 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 270 /* JsxClosingElement */; + || kind === 269 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -120617,10 +120497,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -120687,17 +120567,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 200 /* ParenthesizedExpression */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -120821,7 +120701,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -121168,11 +121048,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -121189,12 +121069,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -121252,9 +121132,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -121269,7 +121149,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 202 /* FunctionExpression */) { + if (node.kind === 201 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -121277,7 +121157,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 245 /* FunctionDeclaration */) { + if (node.kind === 244 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -121296,7 +121176,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121382,11 +121262,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 269 /* JsxOpeningElement */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121430,7 +121310,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121450,7 +121330,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -121506,29 +121386,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 163 /* Constructor */) { + if (functionDeclaration_1.kind === 162 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -121539,7 +121419,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -121562,7 +121442,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -121583,9 +121463,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -121604,7 +121484,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -121612,21 +121492,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 167 /* ConstructSignature */) { + if (declaration.kind === 166 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 248 /* TypeAliasDeclaration */) { + else if (declaration.kind === 247 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -121638,7 +121518,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 285 /* EnumMember */) { + if (declaration.kind === 284 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -121668,17 +121548,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -121687,13 +121567,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 254 /* ImportEqualsDeclaration */) { + if (declaration.kind === 253 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -121766,10 +121646,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -121887,16 +121767,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 202 /* FunctionExpression */) { + if (declaration.kind === 201 /* FunctionExpression */) { return true; } - if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { + if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { + if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { return false; } } @@ -122196,10 +122076,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 274 /* JsxAttribute */: - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 273 /* JsxAttribute */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122391,7 +122271,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122406,9 +122286,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -122482,7 +122362,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -122506,34 +122386,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 131 /* DeclareKeyword */, + 130 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 132 /* GetKeyword */, + 131 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 136 /* ModuleKeyword */, - 137 /* NamespaceKeyword */, + 135 /* ModuleKeyword */, + 136 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 139 /* ReadonlyKeyword */, - 143 /* SetKeyword */, + 138 /* ReadonlyKeyword */, + 142 /* SetKeyword */, 120 /* StaticKeyword */, - 146 /* TypeKeyword */, - 150 /* FromKeyword */, - 135 /* KeyOfKeyword */, - 133 /* InferKeyword */, + 145 /* TypeKeyword */, + 149 /* FromKeyword */, + 134 /* KeyOfKeyword */, + 132 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -122564,8 +122444,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 132 /* GetKeyword */, - 143 /* SetKeyword */, + 131 /* GetKeyword */, + 142 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -122576,8 +122456,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -122719,51 +122599,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 231 /* ForStatement */; + return context.contextNode.kind === 230 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 211 /* ConditionalExpression */: - case 181 /* ConditionalType */: - case 218 /* AsExpression */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 169 /* TypePredicate */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 210 /* ConditionalExpression */: + case 180 /* ConditionalType */: + case 217 /* AsExpression */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 168 /* TypePredicate */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 192 /* BindingElement */: + case 191 /* BindingElement */: // equals in type X = ... // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: // equal in p = 0 // falls through - case 157 /* Parameter */: - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 233 /* ForOfStatement */: - return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; + case 232 /* ForOfStatement */: + return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; } return false; } @@ -122775,22 +122655,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 160 /* PropertyDeclaration */ || - contextKind === 159 /* PropertySignature */ || - contextKind === 157 /* Parameter */ || - contextKind === 243 /* VariableDeclaration */ || + return contextKind === 159 /* PropertyDeclaration */ || + contextKind === 158 /* PropertySignature */ || + contextKind === 156 /* Parameter */ || + contextKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 211 /* ConditionalExpression */ || - context.contextNode.kind === 181 /* ConditionalType */; + return context.contextNode.kind === 210 /* ConditionalExpression */ || + context.contextNode.kind === 180 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 190 /* ObjectBindingPattern */ || - context.contextNode.kind === 187 /* MappedType */ || + return context.contextNode.kind === 189 /* ObjectBindingPattern */ || + context.contextNode.kind === 186 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -122816,34 +122696,34 @@ var ts; return true; } switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 194 /* ObjectLiteralExpression */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 193 /* ObjectLiteralExpression */: + case 250 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 166 /* CallSignature */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 202 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -122852,40 +122732,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; + return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 174 /* TypeLiteral */: - case 250 /* ModuleDeclaration */: - case 261 /* ExportDeclaration */: - case 262 /* NamedExports */: - case 255 /* ImportDeclaration */: - case 258 /* NamedImports */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 173 /* TypeLiteral */: + case 249 /* ModuleDeclaration */: + case 260 /* ExportDeclaration */: + case 261 /* NamedExports */: + case 254 /* ImportDeclaration */: + case 257 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 281 /* CatchClause */: - case 251 /* ModuleBlock */: - case 238 /* SwitchStatement */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 280 /* CatchClause */: + case 250 /* ModuleBlock */: + case 237 /* SwitchStatement */: return true; - case 224 /* Block */: { + case 223 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { return true; } } @@ -122894,32 +122774,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 237 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 236 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 194 /* ObjectLiteralExpression */; + return context.contextNode.kind === 193 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 197 /* CallExpression */; + return context.contextNode.kind === 196 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 198 /* NewExpression */; + return context.contextNode.kind === 197 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -122934,28 +122814,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 203 /* ArrowFunction */; + return context.contextNode.kind === 202 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 189 /* ImportType */; + return context.contextNode.kind === 188 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; + return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; + return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 274 /* JsxAttribute */; + return context.nextTokenParent.kind === 273 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 274 /* JsxAttribute */; + return context.contextNode.kind === 273 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 268 /* JsxSelfClosingElement */; + return context.contextNode.kind === 267 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -122970,45 +122850,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 250 /* ModuleDeclaration */; + return context.contextNode.kind === 249 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 167 /* ConstructSignature */; + return context.contextNode.kind === 166 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 170 /* TypeReference */: - case 200 /* TypeAssertionExpression */: - case 248 /* TypeAliasDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 199 /* TypeAssertionExpression */: + case 247 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -123019,28 +122899,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 200 /* TypeAssertionExpression */; + return context.contextNode.kind === 199 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 219 /* NonNullExpression */; + return context.contextNode.kind === 218 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 227 /* IfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; default: return false; @@ -123065,12 +122945,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 223 /* SemicolonClassElement */ || + if (nextTokenKind === 222 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || - context.contextNode.kind === 248 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || + context.contextNode.kind === 247 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -123084,9 +122964,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 231 /* ForStatement */ - && context.currentTokenParent.kind !== 225 /* EmptyStatement */ - && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 230 /* ForStatement */ + && context.currentTokenParent.kind !== 224 /* EmptyStatement */ + && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -123094,7 +122974,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 212 /* TemplateExpression */ + && nextTokenKind !== 211 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -123185,12 +123065,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 153 /* LastToken */ + 1; + var mapRowLength = 152 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123378,17 +123258,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 291 /* SourceFile */: - case 224 /* Block */: - case 251 /* ModuleBlock */: + return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 290 /* SourceFile */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -123615,19 +123495,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; - case 164 /* GetAccessor */: return 132 /* GetKeyword */; - case 165 /* SetAccessor */: return 143 /* SetKeyword */; - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; + case 163 /* GetAccessor */: return 131 /* GetKeyword */; + case 164 /* SetAccessor */: return 142 /* SetKeyword */; + case 161 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -123684,15 +123564,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 187 /* MappedType */) { + if (container.kind !== 186 /* MappedType */) { return false; } break; @@ -123795,7 +123675,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -123815,7 +123695,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -124258,12 +124138,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 202 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -124271,8 +124151,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -124280,12 +124160,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 170 /* TypeReference */: + case 169 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124403,7 +124283,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -124557,7 +124437,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -124605,7 +124485,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -124643,40 +124523,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getList(node.typeArguments); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return getList(node.properties); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getList(node.elements); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return getList(node.members); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 198 /* NewExpression */: - case 197 /* CallExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return getList(node.declarations); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return getList(node.elements); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -124699,7 +124579,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -124772,87 +124652,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 227 /* ExpressionStatement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 193 /* ArrayLiteralExpression */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 187 /* MappedType */: - case 176 /* TupleType */: - case 252 /* CaseBlock */: - case 279 /* DefaultClause */: - case 278 /* CaseClause */: - case 201 /* ParenthesizedExpression */: - case 195 /* PropertyAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 226 /* VariableStatement */: - case 260 /* ExportAssignment */: - case 236 /* ReturnStatement */: - case 211 /* ConditionalExpression */: - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: - case 268 /* JsxSelfClosingElement */: - case 277 /* JsxExpression */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 157 /* Parameter */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 183 /* ParenthesizedType */: - case 199 /* TaggedTemplateExpression */: - case 207 /* AwaitExpression */: - case 262 /* NamedExports */: - case 258 /* NamedImports */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 160 /* PropertyDeclaration */: + case 226 /* ExpressionStatement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 192 /* ArrayLiteralExpression */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 186 /* MappedType */: + case 175 /* TupleType */: + case 251 /* CaseBlock */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: + case 200 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 225 /* VariableStatement */: + case 259 /* ExportAssignment */: + case 235 /* ReturnStatement */: + case 210 /* ConditionalExpression */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: + case 267 /* JsxSelfClosingElement */: + case 276 /* JsxExpression */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 156 /* Parameter */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 182 /* ParenthesizedType */: + case 198 /* TaggedTemplateExpression */: + case 206 /* AwaitExpression */: + case 261 /* NamedExports */: + case 257 /* NamedImports */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 159 /* PropertyDeclaration */: return true; - case 243 /* VariableDeclaration */: - case 282 /* PropertyAssignment */: - case 210 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 242 /* VariableDeclaration */: + case 281 /* PropertyAssignment */: + case 209 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 210 /* BinaryExpression */) { + if (parent.kind !== 209 /* BinaryExpression */) { return true; } break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return childKind !== 224 /* Block */; - case 261 /* ExportDeclaration */: - return childKind !== 262 /* NamedExports */; - case 255 /* ImportDeclaration */: - return childKind !== 256 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); - case 267 /* JsxElement */: - return childKind !== 270 /* JsxClosingElement */; - case 271 /* JsxFragment */: - return childKind !== 273 /* JsxClosingFragment */; - case 180 /* IntersectionType */: - case 179 /* UnionType */: - if (childKind === 174 /* TypeLiteral */) { + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return childKind !== 223 /* Block */; + case 260 /* ExportDeclaration */: + return childKind !== 261 /* NamedExports */; + case 254 /* ImportDeclaration */: + return childKind !== 255 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); + case 266 /* JsxElement */: + return childKind !== 269 /* JsxClosingElement */; + case 270 /* JsxFragment */: + return childKind !== 272 /* JsxClosingFragment */; + case 179 /* IntersectionType */: + case 178 /* UnionType */: + if (childKind === 173 /* TypeLiteral */) { return false; } // falls through @@ -124863,11 +124743,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: - return parent.kind !== 224 /* Block */; + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: + return parent.kind !== 223 /* Block */; default: return false; } @@ -125009,7 +124889,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -125195,7 +125075,7 @@ var ts; } } else { - endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -125349,18 +125229,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 157 /* Parameter */: + case 156 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -125369,7 +125249,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 203 /* ArrowFunction */) { + if (node.kind === 202 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125383,14 +125263,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 224 /* Block */) { + if (node.body.kind !== 223 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -125955,14 +125835,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 157 /* Parameter */: { + case 156 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -125977,15 +125857,15 @@ var ts; } break; } - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -125993,13 +125873,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -126008,7 +125888,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -126061,13 +125941,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 281 /* CatchClause */) { + if (parent.kind === 280 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -126078,14 +125958,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -126264,8 +126144,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126496,7 +126376,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -126574,10 +126454,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || - ancestor.parent.kind === 202 /* FunctionExpression */ || - ancestor.parent.kind === 203 /* ArrowFunction */ || - ancestor.parent.kind === 162 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || + ancestor.parent.kind === 201 /* FunctionExpression */ || + ancestor.parent.kind === 202 /* ArrowFunction */ || + ancestor.parent.kind === 161 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -126696,10 +126576,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -126714,7 +126594,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -126763,9 +126643,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 160 /* PropertyDeclaration */ && + if (declaration.kind === 159 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -126900,26 +126780,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 243 /* VariableDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 242 /* VariableDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 159 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -126941,7 +126821,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -126981,8 +126861,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -127016,12 +126896,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127076,7 +126956,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127084,7 +126964,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127092,12 +126972,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 203 /* ArrowFunction */: { + case 202 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 224 /* Block */) { + if (arrowFunctionBody.kind === 223 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127125,7 +127005,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -127492,8 +127372,8 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -127698,10 +127578,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -127754,20 +127634,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 197 /* CallExpression */: { + case 196 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -127809,8 +127689,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: { + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -127861,16 +127741,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return undefined; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -127934,7 +127814,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -127942,10 +127822,10 @@ var ts; } } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -127963,7 +127843,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -127976,7 +127856,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 191 /* ArrayBindingPattern */: { + case 190 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128059,11 +127939,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return parent.propertyName !== node; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -128569,11 +128449,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -128583,11 +128463,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return declaration.name.text; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -128596,10 +128476,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 254 /* ImportEqualsDeclaration */) + if (declaration.kind === 253 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 243 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ + if (declaration.kind === 242 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -128607,7 +128487,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -128620,7 +128500,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { + if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -128663,9 +128543,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -128876,7 +128756,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 190 /* ObjectBindingPattern */) { + if (clause.kind === 189 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -129500,7 +129380,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 215 /* ClassExpression */) { + if (classDeclaration.kind === 214 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -129548,7 +129428,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 210 /* BinaryExpression */) { + if (token.parent.parent.kind === 209 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -129594,7 +129474,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -129618,7 +129498,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130181,7 +130061,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130213,7 +130093,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 133 /* InferKeyword */) + if (token.kind === 132 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130232,7 +130112,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130243,7 +130123,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130259,7 +130139,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 157 /* Parameter */) { + if (decl.kind === 156 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130270,7 +130150,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130279,7 +130159,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130288,14 +130168,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 157 /* Parameter */: - case 156 /* TypeParameter */: + case 156 /* Parameter */: + case 155 /* TypeParameter */: return true; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return true; } } @@ -130342,17 +130222,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: return true; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130361,7 +130241,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130410,7 +130290,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130421,8 +130301,8 @@ var ts; return; } // falls through - case 230 /* WhileStatement */: - case 231 /* ForStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -130495,7 +130375,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 298 /* JSDocNullableType */) { + if (typeNode.kind === 297 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -130515,7 +130395,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -130532,22 +130412,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 218 /* AsExpression */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 245 /* FunctionDeclaration */: - case 164 /* GetAccessor */: - case 168 /* IndexSignature */: - case 187 /* MappedType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 200 /* TypeAssertionExpression */: - case 243 /* VariableDeclaration */: + case 217 /* AsExpression */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 163 /* GetAccessor */: + case 167 /* IndexSignature */: + case 186 /* MappedType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 199 /* TypeAssertionExpression */: + case 242 /* VariableDeclaration */: return true; default: return false; @@ -130649,14 +130529,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -130929,7 +130809,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -130978,14 +130858,14 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 160 /* PropertyDeclaration */) { + if (signature.parent.kind === 159 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -130995,14 +130875,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 318 /* JSDocParameterTag */: { + case 317 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -131027,18 +130907,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 163 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); + case 162 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -131180,24 +131060,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -131205,20 +131085,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -131337,7 +131217,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -131365,7 +131245,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 197 /* CallExpression */) { + if (parent.kind === 196 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -131581,9 +131461,6 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } - else if (genericType.flags & 134217728 /* Awaited */) { - return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); - } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -131600,7 +131477,6 @@ var ts; } var genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */); var usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */); - // allow for multiple overloads of `then`. if (genericSigs.length === 1 && usageSigs.length === 1) { return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); } @@ -131759,8 +131635,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -131774,8 +131650,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: { + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -131804,8 +131680,8 @@ var ts; } break; } - case 161 /* MethodSignature */: - case 162 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 161 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -131850,7 +131726,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -132112,7 +131988,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -132231,7 +132107,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -132407,7 +132283,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -132459,7 +132335,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -132660,16 +132536,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: { + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -132697,12 +132573,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -132710,9 +132586,9 @@ var ts; break; } // falls through - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -132739,18 +132615,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: { + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 256 /* ImportClause */: { + case 255 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -132759,7 +132635,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 257 /* NamespaceImport */) { + else if (namedBindings.kind === 256 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -132780,11 +132656,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 259 /* ImportSpecifier */: { + case 258 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -132797,7 +132673,7 @@ var ts; } break; } - case 264 /* ExportSpecifier */: { + case 263 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -132830,8 +132706,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -132853,7 +132729,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 257 /* NamespaceImport */) { + if (toConvert.kind === 256 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -133200,20 +133076,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 160 /* PropertyDeclaration */) { + if (current.kind === 159 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 157 /* Parameter */) { + else if (current.kind === 156 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 163 /* Constructor */) { + if (ctorOrMethod.kind === 162 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 162 /* MethodDeclaration */) { + else if (current.kind === 161 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -133256,7 +133132,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -133268,13 +133144,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 197 /* CallExpression */) { + if (node.parent.kind === 196 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -133289,8 +133165,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -133302,21 +133178,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 224 /* Block */: - if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { + case 223 /* Block */: + if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 279 /* DefaultClause */: - case 278 /* CaseClause */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -133328,19 +133204,19 @@ var ts; break; } switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: { + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -133349,20 +133225,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -133416,7 +133292,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 157 /* Parameter */) { + if (current.kind === 156 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -133427,7 +133303,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 291 /* SourceFile */) { + if (current.kind === 290 /* SourceFile */) { return scopes; } } @@ -133517,32 +133393,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return "arrow function"; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 246 /* ClassDeclaration */ + return scope.kind === 245 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 251 /* ModuleBlock */ + return scope.kind === 250 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -133762,9 +133638,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } } /** @@ -133793,7 +133669,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -133822,7 +133698,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -133841,7 +133717,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -133985,7 +133861,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -134163,7 +134039,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -134479,30 +134355,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 285 /* EnumMember */: + case 284 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 255 /* ImportDeclaration */ && - parent.kind !== 259 /* ImportSpecifier */; - case 214 /* SpreadElement */: - case 190 /* ObjectBindingPattern */: - case 192 /* BindingElement */: + return parent.kind !== 254 /* ImportDeclaration */ && + parent.kind !== 258 /* ImportSpecifier */; + case 213 /* SpreadElement */: + case 189 /* ObjectBindingPattern */: + case 191 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 192 /* BindingElement */ && - parent.kind !== 259 /* ImportSpecifier */ && - parent.kind !== 264 /* ExportSpecifier */; + return parent.kind !== 191 /* BindingElement */ && + parent.kind !== 258 /* ImportSpecifier */ && + parent.kind !== 263 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 224 /* Block */: - case 291 /* SourceFile */: - case 251 /* ModuleBlock */: - case 278 /* CaseClause */: + case 223 /* Block */: + case 290 /* SourceFile */: + case 250 /* ModuleBlock */: + case 277 /* CaseClause */: return true; default: return false; @@ -134666,7 +134542,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(323 /* JSDocTypedefTag */); + var node = ts.createNode(322 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -134674,10 +134550,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(322 /* JSDocTemplateTag */); + var template = ts.createNode(321 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(156 /* TypeParameter */); + var parameter = ts.createNode(155 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -134788,7 +134664,7 @@ var ts; isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -134931,11 +134807,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return true; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -135023,12 +134899,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? + case 254 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -135059,20 +134935,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -135142,15 +135018,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -135163,7 +135039,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -135175,7 +135051,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 258 /* NamedImports */) { + else if (namedBindings.kind === 257 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -135193,9 +135069,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -135322,13 +135198,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: return true; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -135340,7 +135216,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -135350,9 +135226,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -135361,7 +135237,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -135373,9 +135249,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return name; - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -135432,13 +135308,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -135446,17 +135322,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return cb(statement); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -135468,8 +135344,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -135480,9 +135356,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return d.parent.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -135515,23 +135391,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -135542,18 +135418,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -135823,15 +135699,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -135841,7 +135717,7 @@ var ts; } break; // x["foo"](...) - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -135860,14 +135736,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -135909,11 +135785,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 163 /* Constructor */: + case 162 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -135921,8 +135797,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -136093,7 +135969,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -136101,7 +135977,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -136112,25 +135988,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return [functionDeclaration.name]; - case 163 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { + case 162 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -136381,8 +136257,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); - return child.kind < 154 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); + return child.kind < 153 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -136393,7 +136269,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -136451,7 +136327,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -136765,7 +136641,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 291 /* SourceFile */; + _this.kind = 290 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -136824,10 +136700,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -136847,31 +136723,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 173 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: { + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -136882,12 +136758,12 @@ var ts; } } // falls through - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: addDeclaration(node); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -136900,7 +136776,7 @@ var ts; } } break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -136912,7 +136788,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -136921,7 +136797,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -137540,12 +137416,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -137647,15 +137523,15 @@ var ts; return undefined; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -137672,7 +137548,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -138149,7 +138025,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 266 /* ExternalModuleReference */ || + node.parent.kind === 265 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -138167,13 +138043,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 155 /* ComputedPropertyName */) { + if (node.parent.kind === 154 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && + (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -138215,7 +138091,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 196 /* ElementAccessExpression */ && + node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -138295,114 +138171,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return spanInVariableDeclaration(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return spanInParameterDeclaration(node); - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanInBlock(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInBlock(node.block); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return spanInForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 192 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 191 /* BindingElement */: // span on complete node return textSpan(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 158 /* Decorator */: + case 157 /* Decorator */: return spanInNodeArray(parent.decorators); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -138432,7 +138308,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 153 /* OfKeyword */: + case 152 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -138445,13 +138321,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 214 /* SpreadElement */ || - node.kind === 282 /* PropertyAssignment */ || - node.kind === 283 /* ShorthandPropertyAssignment */) && + node.kind === 213 /* SpreadElement */ || + node.kind === 281 /* PropertyAssignment */ || + node.kind === 282 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -138473,22 +138349,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 158 /* Decorator */: + case 157 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return textSpan(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -138497,21 +138373,21 @@ var ts; } } switch (node.parent.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: { + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -138519,7 +138395,7 @@ var ts; } break; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -138549,7 +138425,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -138561,7 +138437,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 233 /* ForOfStatement */) { + parent.parent.kind === 232 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -138602,7 +138478,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); + (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -138625,26 +138501,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 232 /* ForInStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 231 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -138669,21 +138545,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 192 /* BindingElement */) { + if (bindingPattern.parent.kind === 191 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); - var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); + var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -138691,18 +138567,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -138710,25 +138586,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 249 /* EnumDeclaration */: - case 246 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -138736,7 +138612,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138752,7 +138628,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -138767,12 +138643,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 197 /* CallExpression */ || - node.parent.kind === 198 /* NewExpression */) { + if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 196 /* CallExpression */ || + node.parent.kind === 197 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 201 /* ParenthesizedExpression */) { + if (node.parent.kind === 200 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -138781,21 +138657,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 201 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 200 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -138805,20 +138681,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ || - node.parent.kind === 157 /* Parameter */) { + node.parent.kind === 281 /* PropertyAssignment */ || + node.parent.kind === 156 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 200 /* TypeAssertionExpression */) { + if (node.parent.kind === 199 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 229 /* DoStatement */) { + if (node.parent.kind === 228 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -138826,7 +138702,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.kind === 232 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 25747ebefe2..9a205fa5bd4 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,211 +203,210 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - AwaitedKeyword = 128, - BooleanKeyword = 129, - ConstructorKeyword = 130, - DeclareKeyword = 131, - GetKeyword = 132, - InferKeyword = 133, - IsKeyword = 134, - KeyOfKeyword = 135, - ModuleKeyword = 136, - NamespaceKeyword = 137, - NeverKeyword = 138, - ReadonlyKeyword = 139, - RequireKeyword = 140, - NumberKeyword = 141, - ObjectKeyword = 142, - SetKeyword = 143, - StringKeyword = 144, - SymbolKeyword = 145, - TypeKeyword = 146, - UndefinedKeyword = 147, - UniqueKeyword = 148, - UnknownKeyword = 149, - FromKeyword = 150, - GlobalKeyword = 151, - BigIntKeyword = 152, - OfKeyword = 153, - QualifiedName = 154, - ComputedPropertyName = 155, - TypeParameter = 156, - Parameter = 157, - Decorator = 158, - PropertySignature = 159, - PropertyDeclaration = 160, - MethodSignature = 161, - MethodDeclaration = 162, - Constructor = 163, - GetAccessor = 164, - SetAccessor = 165, - CallSignature = 166, - ConstructSignature = 167, - IndexSignature = 168, - TypePredicate = 169, - TypeReference = 170, - FunctionType = 171, - ConstructorType = 172, - TypeQuery = 173, - TypeLiteral = 174, - ArrayType = 175, - TupleType = 176, - OptionalType = 177, - RestType = 178, - UnionType = 179, - IntersectionType = 180, - ConditionalType = 181, - InferType = 182, - ParenthesizedType = 183, - ThisType = 184, - TypeOperator = 185, - IndexedAccessType = 186, - MappedType = 187, - LiteralType = 188, - ImportType = 189, - ObjectBindingPattern = 190, - ArrayBindingPattern = 191, - BindingElement = 192, - ArrayLiteralExpression = 193, - ObjectLiteralExpression = 194, - PropertyAccessExpression = 195, - ElementAccessExpression = 196, - CallExpression = 197, - NewExpression = 198, - TaggedTemplateExpression = 199, - TypeAssertionExpression = 200, - ParenthesizedExpression = 201, - FunctionExpression = 202, - ArrowFunction = 203, - DeleteExpression = 204, - TypeOfExpression = 205, - VoidExpression = 206, - AwaitExpression = 207, - PrefixUnaryExpression = 208, - PostfixUnaryExpression = 209, - BinaryExpression = 210, - ConditionalExpression = 211, - TemplateExpression = 212, - YieldExpression = 213, - SpreadElement = 214, - ClassExpression = 215, - OmittedExpression = 216, - ExpressionWithTypeArguments = 217, - AsExpression = 218, - NonNullExpression = 219, - MetaProperty = 220, - SyntheticExpression = 221, - TemplateSpan = 222, - SemicolonClassElement = 223, - Block = 224, - EmptyStatement = 225, - VariableStatement = 226, - ExpressionStatement = 227, - IfStatement = 228, - DoStatement = 229, - WhileStatement = 230, - ForStatement = 231, - ForInStatement = 232, - ForOfStatement = 233, - ContinueStatement = 234, - BreakStatement = 235, - ReturnStatement = 236, - WithStatement = 237, - SwitchStatement = 238, - LabeledStatement = 239, - ThrowStatement = 240, - TryStatement = 241, - DebuggerStatement = 242, - VariableDeclaration = 243, - VariableDeclarationList = 244, - FunctionDeclaration = 245, - ClassDeclaration = 246, - InterfaceDeclaration = 247, - TypeAliasDeclaration = 248, - EnumDeclaration = 249, - ModuleDeclaration = 250, - ModuleBlock = 251, - CaseBlock = 252, - NamespaceExportDeclaration = 253, - ImportEqualsDeclaration = 254, - ImportDeclaration = 255, - ImportClause = 256, - NamespaceImport = 257, - NamedImports = 258, - ImportSpecifier = 259, - ExportAssignment = 260, - ExportDeclaration = 261, - NamedExports = 262, - NamespaceExport = 263, - ExportSpecifier = 264, - MissingDeclaration = 265, - ExternalModuleReference = 266, - JsxElement = 267, - JsxSelfClosingElement = 268, - JsxOpeningElement = 269, - JsxClosingElement = 270, - JsxFragment = 271, - JsxOpeningFragment = 272, - JsxClosingFragment = 273, - JsxAttribute = 274, - JsxAttributes = 275, - JsxSpreadAttribute = 276, - JsxExpression = 277, - CaseClause = 278, - DefaultClause = 279, - HeritageClause = 280, - CatchClause = 281, - PropertyAssignment = 282, - ShorthandPropertyAssignment = 283, - SpreadAssignment = 284, - EnumMember = 285, - UnparsedPrologue = 286, - UnparsedPrepend = 287, - UnparsedText = 288, - UnparsedInternalText = 289, - UnparsedSyntheticReference = 290, - SourceFile = 291, - Bundle = 292, - UnparsedSource = 293, - InputFiles = 294, - JSDocTypeExpression = 295, - JSDocAllType = 296, - JSDocUnknownType = 297, - JSDocNullableType = 298, - JSDocNonNullableType = 299, - JSDocOptionalType = 300, - JSDocFunctionType = 301, - JSDocVariadicType = 302, - JSDocNamepathType = 303, - JSDocComment = 304, - JSDocTypeLiteral = 305, - JSDocSignature = 306, - JSDocTag = 307, - JSDocAugmentsTag = 308, - JSDocImplementsTag = 309, - JSDocAuthorTag = 310, - JSDocClassTag = 311, - JSDocPublicTag = 312, - JSDocPrivateTag = 313, - JSDocProtectedTag = 314, - JSDocReadonlyTag = 315, - JSDocCallbackTag = 316, - JSDocEnumTag = 317, - JSDocParameterTag = 318, - JSDocReturnTag = 319, - JSDocThisTag = 320, - JSDocTypeTag = 321, - JSDocTemplateTag = 322, - JSDocTypedefTag = 323, - JSDocPropertyTag = 324, - SyntaxList = 325, - NotEmittedStatement = 326, - PartiallyEmittedExpression = 327, - CommaListExpression = 328, - MergeDeclarationMarker = 329, - EndOfDeclarationMarker = 330, - SyntheticReferenceExpression = 331, - Count = 332, + BooleanKeyword = 128, + ConstructorKeyword = 129, + DeclareKeyword = 130, + GetKeyword = 131, + InferKeyword = 132, + IsKeyword = 133, + KeyOfKeyword = 134, + ModuleKeyword = 135, + NamespaceKeyword = 136, + NeverKeyword = 137, + ReadonlyKeyword = 138, + RequireKeyword = 139, + NumberKeyword = 140, + ObjectKeyword = 141, + SetKeyword = 142, + StringKeyword = 143, + SymbolKeyword = 144, + TypeKeyword = 145, + UndefinedKeyword = 146, + UniqueKeyword = 147, + UnknownKeyword = 148, + FromKeyword = 149, + GlobalKeyword = 150, + BigIntKeyword = 151, + OfKeyword = 152, + QualifiedName = 153, + ComputedPropertyName = 154, + TypeParameter = 155, + Parameter = 156, + Decorator = 157, + PropertySignature = 158, + PropertyDeclaration = 159, + MethodSignature = 160, + MethodDeclaration = 161, + Constructor = 162, + GetAccessor = 163, + SetAccessor = 164, + CallSignature = 165, + ConstructSignature = 166, + IndexSignature = 167, + TypePredicate = 168, + TypeReference = 169, + FunctionType = 170, + ConstructorType = 171, + TypeQuery = 172, + TypeLiteral = 173, + ArrayType = 174, + TupleType = 175, + OptionalType = 176, + RestType = 177, + UnionType = 178, + IntersectionType = 179, + ConditionalType = 180, + InferType = 181, + ParenthesizedType = 182, + ThisType = 183, + TypeOperator = 184, + IndexedAccessType = 185, + MappedType = 186, + LiteralType = 187, + ImportType = 188, + ObjectBindingPattern = 189, + ArrayBindingPattern = 190, + BindingElement = 191, + ArrayLiteralExpression = 192, + ObjectLiteralExpression = 193, + PropertyAccessExpression = 194, + ElementAccessExpression = 195, + CallExpression = 196, + NewExpression = 197, + TaggedTemplateExpression = 198, + TypeAssertionExpression = 199, + ParenthesizedExpression = 200, + FunctionExpression = 201, + ArrowFunction = 202, + DeleteExpression = 203, + TypeOfExpression = 204, + VoidExpression = 205, + AwaitExpression = 206, + PrefixUnaryExpression = 207, + PostfixUnaryExpression = 208, + BinaryExpression = 209, + ConditionalExpression = 210, + TemplateExpression = 211, + YieldExpression = 212, + SpreadElement = 213, + ClassExpression = 214, + OmittedExpression = 215, + ExpressionWithTypeArguments = 216, + AsExpression = 217, + NonNullExpression = 218, + MetaProperty = 219, + SyntheticExpression = 220, + TemplateSpan = 221, + SemicolonClassElement = 222, + Block = 223, + EmptyStatement = 224, + VariableStatement = 225, + ExpressionStatement = 226, + IfStatement = 227, + DoStatement = 228, + WhileStatement = 229, + ForStatement = 230, + ForInStatement = 231, + ForOfStatement = 232, + ContinueStatement = 233, + BreakStatement = 234, + ReturnStatement = 235, + WithStatement = 236, + SwitchStatement = 237, + LabeledStatement = 238, + ThrowStatement = 239, + TryStatement = 240, + DebuggerStatement = 241, + VariableDeclaration = 242, + VariableDeclarationList = 243, + FunctionDeclaration = 244, + ClassDeclaration = 245, + InterfaceDeclaration = 246, + TypeAliasDeclaration = 247, + EnumDeclaration = 248, + ModuleDeclaration = 249, + ModuleBlock = 250, + CaseBlock = 251, + NamespaceExportDeclaration = 252, + ImportEqualsDeclaration = 253, + ImportDeclaration = 254, + ImportClause = 255, + NamespaceImport = 256, + NamedImports = 257, + ImportSpecifier = 258, + ExportAssignment = 259, + ExportDeclaration = 260, + NamedExports = 261, + NamespaceExport = 262, + ExportSpecifier = 263, + MissingDeclaration = 264, + ExternalModuleReference = 265, + JsxElement = 266, + JsxSelfClosingElement = 267, + JsxOpeningElement = 268, + JsxClosingElement = 269, + JsxFragment = 270, + JsxOpeningFragment = 271, + JsxClosingFragment = 272, + JsxAttribute = 273, + JsxAttributes = 274, + JsxSpreadAttribute = 275, + JsxExpression = 276, + CaseClause = 277, + DefaultClause = 278, + HeritageClause = 279, + CatchClause = 280, + PropertyAssignment = 281, + ShorthandPropertyAssignment = 282, + SpreadAssignment = 283, + EnumMember = 284, + UnparsedPrologue = 285, + UnparsedPrepend = 286, + UnparsedText = 287, + UnparsedInternalText = 288, + UnparsedSyntheticReference = 289, + SourceFile = 290, + Bundle = 291, + UnparsedSource = 292, + InputFiles = 293, + JSDocTypeExpression = 294, + JSDocAllType = 295, + JSDocUnknownType = 296, + JSDocNullableType = 297, + JSDocNonNullableType = 298, + JSDocOptionalType = 299, + JSDocFunctionType = 300, + JSDocVariadicType = 301, + JSDocNamepathType = 302, + JSDocComment = 303, + JSDocTypeLiteral = 304, + JSDocSignature = 305, + JSDocTag = 306, + JSDocAugmentsTag = 307, + JSDocImplementsTag = 308, + JSDocAuthorTag = 309, + JSDocClassTag = 310, + JSDocPublicTag = 311, + JSDocPrivateTag = 312, + JSDocProtectedTag = 313, + JSDocReadonlyTag = 314, + JSDocCallbackTag = 315, + JSDocEnumTag = 316, + JSDocParameterTag = 317, + JSDocReturnTag = 318, + JSDocThisTag = 319, + JSDocTypeTag = 320, + JSDocTemplateTag = 321, + JSDocTypedefTag = 322, + JSDocPropertyTag = 323, + SyntaxList = 324, + NotEmittedStatement = 325, + PartiallyEmittedExpression = 326, + CommaListExpression = 327, + MergeDeclarationMarker = 328, + EndOfDeclarationMarker = 329, + SyntheticReferenceExpression = 330, + Count = 331, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -415,15 +414,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 153, + LastKeyword = 152, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 169, - LastTypeNode = 189, + FirstTypeNode = 168, + LastTypeNode = 188, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 153, + LastToken = 152, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -432,13 +431,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 226, - LastStatement = 242, - FirstNode = 154, - FirstJSDocNode = 295, - LastJSDocNode = 324, - FirstJSDocTagNode = 307, - LastJSDocTagNode = 324, + FirstStatement = 225, + LastStatement = 241, + FirstNode = 153, + FirstJSDocNode = 294, + LastJSDocNode = 323, + FirstJSDocTagNode = 306, + LastJSDocTagNode = 323, } export enum NodeFlags { None = 0, @@ -845,7 +844,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1138,7 +1137,7 @@ declare namespace ts { export interface CallChain extends CallExpression { _optionalChainBrand: any; } - export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain; + export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; export interface SuperCall extends CallExpression { expression: SuperExpression; } @@ -1178,6 +1177,9 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + export interface NonNullChain extends NonNullExpression { + _optionalChainBrand: any; + } export interface MetaProperty extends PrimaryExpression { kind: SyntaxKind.MetaProperty; keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; @@ -2361,7 +2363,6 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2376,11 +2377,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 193200128, + InstantiableNonPrimitive = 58982400, InstantiablePrimitive = 4194304, - Instantiable = 197394432, - StructuredOrInstantiable = 201064448, - Narrowable = 268188671, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2528,9 +2529,6 @@ declare namespace ts { baseType: Type; substitute: Type; } - export interface AwaitedType extends InstantiableType { - awaitedType: Type; - } export enum SignatureKind { Call = 0, Construct = 1 @@ -3634,7 +3632,7 @@ declare namespace ts { function isElementAccessChain(node: Node): node is ElementAccessChain; function isCallExpression(node: Node): node is CallExpression; function isCallChain(node: Node): node is CallChain; - function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain; + function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; function isNullishCoalesce(node: Node): boolean; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; @@ -3661,6 +3659,7 @@ declare namespace ts { function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; function isAsExpression(node: Node): node is AsExpression; function isNonNullExpression(node: Node): node is NonNullExpression; + function isNonNullChain(node: Node): node is NonNullChain; function isMetaProperty(node: Node): node is MetaProperty; function isTemplateSpan(node: Node): node is TemplateSpan; function isSemicolonClassElement(node: Node): node is SemicolonClassElement; @@ -4071,7 +4070,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4152,6 +4151,8 @@ declare namespace ts { function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; function createNonNullExpression(expression: Expression): NonNullExpression; function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createNonNullChain(expression: Expression): NonNullChain; + function updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; function createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; function updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 27e0276a092..573fa4d6a16 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -3203,234 +3203,233 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3439,15 +3438,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3456,15 +3455,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4010,7 +4009,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4039,10 +4037,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4051,10 +4049,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -8208,8 +8206,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 152 /* BigIntKeyword */, - boolean: 129 /* BooleanKeyword */, + bigint: 151 /* BigIntKeyword */, + boolean: 128 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8217,9 +8215,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 130 /* ConstructorKeyword */, + _a["" + "constructor"] = 129 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 131 /* DeclareKeyword */, + _a.declare = 130 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8230,49 +8228,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 150 /* FromKeyword */, + _a.from = 149 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 132 /* GetKeyword */, + _a.get = 131 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 133 /* InferKeyword */, + _a.infer = 132 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 134 /* IsKeyword */, - _a.keyof = 135 /* KeyOfKeyword */, + _a.is = 133 /* IsKeyword */, + _a.keyof = 134 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 136 /* ModuleKeyword */, - _a.namespace = 137 /* NamespaceKeyword */, - _a.never = 138 /* NeverKeyword */, + _a.module = 135 /* ModuleKeyword */, + _a.namespace = 136 /* NamespaceKeyword */, + _a.never = 137 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 141 /* NumberKeyword */, - _a.object = 142 /* ObjectKeyword */, + _a.number = 140 /* NumberKeyword */, + _a.object = 141 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 139 /* ReadonlyKeyword */, - _a.require = 140 /* RequireKeyword */, - _a.global = 151 /* GlobalKeyword */, + _a.readonly = 138 /* ReadonlyKeyword */, + _a.require = 139 /* RequireKeyword */, + _a.global = 150 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 143 /* SetKeyword */, + _a.set = 142 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 144 /* StringKeyword */, + _a.string = 143 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 145 /* SymbolKeyword */, + _a.symbol = 144 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 146 /* TypeKeyword */, + _a.type = 145 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 147 /* UndefinedKeyword */, - _a.unique = 148 /* UniqueKeyword */, - _a.unknown = 149 /* UnknownKeyword */, + _a.undefined = 146 /* UndefinedKeyword */, + _a.unique = 147 /* UniqueKeyword */, + _a.unknown = 148 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8280,8 +8278,7 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.awaited = 128 /* AwaitedKeyword */, - _a.of = 153 /* OfKeyword */, + _a.of = 152 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -10635,9 +10632,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156 /* TypeParameter */) { + if (d && d.kind === 155 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { return current; } } @@ -10645,7 +10642,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10675,14 +10672,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243 /* VariableDeclaration */) { + if (node.kind === 242 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 244 /* VariableDeclarationList */) { + if (node && node.kind === 243 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226 /* VariableStatement */) { + if (node && node.kind === 225 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10831,30 +10828,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return expr.name; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10891,16 +10888,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: { + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 154 /* QualifiedName */) { + if (name.kind === 153 /* QualifiedName */) { return name.right; } break; } - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10916,15 +10913,15 @@ var ts; return undefined; } } - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 317 /* JSDocEnumTag */: + case 316 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11160,7 +11157,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11231,11 +11228,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 154 /* QualifiedName */; + return node.kind === 153 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155 /* ComputedPropertyName */; + return node.kind === 154 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11248,164 +11245,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 156 /* TypeParameter */; + return node.kind === 155 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157 /* Parameter */; + return node.kind === 156 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 159 /* PropertySignature */; + return node.kind === 158 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160 /* PropertyDeclaration */; + return node.kind === 159 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161 /* MethodSignature */; + return node.kind === 160 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163 /* Constructor */; + return node.kind === 162 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166 /* CallSignature */; + return node.kind === 165 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167 /* ConstructSignature */; + return node.kind === 166 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168 /* IndexSignature */; + return node.kind === 167 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; + return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 169 /* TypePredicate */; + return node.kind === 168 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170 /* TypeReference */; + return node.kind === 169 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171 /* FunctionType */; + return node.kind === 170 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172 /* ConstructorType */; + return node.kind === 171 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174 /* TypeLiteral */; + return node.kind === 173 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175 /* ArrayType */; + return node.kind === 174 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176 /* TupleType */; + return node.kind === 175 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179 /* UnionType */; + return node.kind === 178 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180 /* IntersectionType */; + return node.kind === 179 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181 /* ConditionalType */; + return node.kind === 180 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182 /* InferType */; + return node.kind === 181 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183 /* ParenthesizedType */; + return node.kind === 182 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184 /* ThisType */; + return node.kind === 183 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185 /* TypeOperator */; + return node.kind === 184 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186 /* IndexedAccessType */; + return node.kind === 185 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187 /* MappedType */; + return node.kind === 186 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188 /* LiteralType */; + return node.kind === 187 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189 /* ImportType */; + return node.kind === 188 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 190 /* ObjectBindingPattern */; + return node.kind === 189 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191 /* ArrayBindingPattern */; + return node.kind === 190 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192 /* BindingElement */; + return node.kind === 191 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 193 /* ArrayLiteralExpression */; + return node.kind === 192 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194 /* ObjectLiteralExpression */; + return node.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11413,7 +11410,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196 /* ElementAccessExpression */; + return node.kind === 195 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11421,7 +11418,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197 /* CallExpression */; + return node.kind === 196 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11431,14 +11428,15 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 195 /* PropertyAccessExpression */ - || kind === 196 /* ElementAccessExpression */ - || kind === 197 /* CallExpression */); + (kind === 194 /* PropertyAccessExpression */ + || kind === 195 /* ElementAccessExpression */ + || kind === 196 /* CallExpression */ + || kind === 218 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; /** @@ -11453,33 +11451,34 @@ var ts; * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`: * * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`) - * 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) - * 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is + * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`) + * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) + * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is * the end of the chain starting at `c?.`) - * 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is + * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is * the end of the chain starting at `a?.`) */ /* @internal */ function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) // cases 1 and 2 - || isOptionalChainRoot(node.parent) // case 3 - || node !== node.parent.expression; // case 4 + return !isOptionalChain(node.parent) // cases 1, 2, and 3 + || isOptionalChainRoot(node.parent) // case 4 + || node !== node.parent.expression; // case 5 } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198 /* NewExpression */; + return node.kind === 197 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199 /* TaggedTemplateExpression */; + return node.kind === 198 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200 /* TypeAssertionExpression */; + return node.kind === 199 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11488,384 +11487,385 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201 /* ParenthesizedExpression */; + return node.kind === 200 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202 /* FunctionExpression */; + return node.kind === 201 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203 /* ArrowFunction */; + return node.kind === 202 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204 /* DeleteExpression */; + return node.kind === 203 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205 /* TypeOfExpression */; + return node.kind === 204 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206 /* VoidExpression */; + return node.kind === 205 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207 /* AwaitExpression */; + return node.kind === 206 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208 /* PrefixUnaryExpression */; + return node.kind === 207 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209 /* PostfixUnaryExpression */; + return node.kind === 208 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210 /* BinaryExpression */; + return node.kind === 209 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211 /* ConditionalExpression */; + return node.kind === 210 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212 /* TemplateExpression */; + return node.kind === 211 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213 /* YieldExpression */; + return node.kind === 212 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214 /* SpreadElement */; + return node.kind === 213 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215 /* ClassExpression */; + return node.kind === 214 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216 /* OmittedExpression */; + return node.kind === 215 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218 /* AsExpression */; + return node.kind === 217 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219 /* NonNullExpression */; + return node.kind === 218 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220 /* MetaProperty */; + return node.kind === 219 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 222 /* TemplateSpan */; + return node.kind === 221 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223 /* SemicolonClassElement */; + return node.kind === 222 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 224 /* Block */; + return node.kind === 223 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226 /* VariableStatement */; + return node.kind === 225 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225 /* EmptyStatement */; + return node.kind === 224 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227 /* ExpressionStatement */; + return node.kind === 226 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228 /* IfStatement */; + return node.kind === 227 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229 /* DoStatement */; + return node.kind === 228 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230 /* WhileStatement */; + return node.kind === 229 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231 /* ForStatement */; + return node.kind === 230 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232 /* ForInStatement */; + return node.kind === 231 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233 /* ForOfStatement */; + return node.kind === 232 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234 /* ContinueStatement */; + return node.kind === 233 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235 /* BreakStatement */; + return node.kind === 234 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; + return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236 /* ReturnStatement */; + return node.kind === 235 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237 /* WithStatement */; + return node.kind === 236 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238 /* SwitchStatement */; + return node.kind === 237 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239 /* LabeledStatement */; + return node.kind === 238 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240 /* ThrowStatement */; + return node.kind === 239 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241 /* TryStatement */; + return node.kind === 240 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242 /* DebuggerStatement */; + return node.kind === 241 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243 /* VariableDeclaration */; + return node.kind === 242 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244 /* VariableDeclarationList */; + return node.kind === 243 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245 /* FunctionDeclaration */; + return node.kind === 244 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246 /* ClassDeclaration */; + return node.kind === 245 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247 /* InterfaceDeclaration */; + return node.kind === 246 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248 /* TypeAliasDeclaration */; + return node.kind === 247 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249 /* EnumDeclaration */; + return node.kind === 248 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */; + return node.kind === 249 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251 /* ModuleBlock */; + return node.kind === 250 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252 /* CaseBlock */; + return node.kind === 251 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253 /* NamespaceExportDeclaration */; + return node.kind === 252 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */; + return node.kind === 253 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255 /* ImportDeclaration */; + return node.kind === 254 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256 /* ImportClause */; + return node.kind === 255 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257 /* NamespaceImport */; + return node.kind === 256 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263 /* NamespaceExport */; + return node.kind === 262 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; + return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258 /* NamedImports */; + return node.kind === 257 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259 /* ImportSpecifier */; + return node.kind === 258 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260 /* ExportAssignment */; + return node.kind === 259 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261 /* ExportDeclaration */; + return node.kind === 260 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262 /* NamedExports */; + return node.kind === 261 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264 /* ExportSpecifier */; + return node.kind === 263 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265 /* MissingDeclaration */; + return node.kind === 264 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 266 /* ExternalModuleReference */; + return node.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 267 /* JsxElement */; + return node.kind === 266 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268 /* JsxSelfClosingElement */; + return node.kind === 267 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269 /* JsxOpeningElement */; + return node.kind === 268 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270 /* JsxClosingElement */; + return node.kind === 269 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271 /* JsxFragment */; + return node.kind === 270 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272 /* JsxOpeningFragment */; + return node.kind === 271 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273 /* JsxClosingFragment */; + return node.kind === 272 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274 /* JsxAttribute */; + return node.kind === 273 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275 /* JsxAttributes */; + return node.kind === 274 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276 /* JsxSpreadAttribute */; + return node.kind === 275 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277 /* JsxExpression */; + return node.kind === 276 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 278 /* CaseClause */; + return node.kind === 277 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279 /* DefaultClause */; + return node.kind === 278 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280 /* HeritageClause */; + return node.kind === 279 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281 /* CatchClause */; + return node.kind === 280 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 282 /* PropertyAssignment */; + return node.kind === 281 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */; + return node.kind === 282 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284 /* SpreadAssignment */; + return node.kind === 283 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 291 /* SourceFile */; + return node.kind === 290 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292 /* Bundle */; + return node.kind === 291 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293 /* UnparsedSource */; + return node.kind === 292 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287 /* UnparsedPrepend */; + return node.kind === 286 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return true; default: return false; @@ -11874,125 +11874,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 /* UnparsedPrologue */ || - node.kind === 290 /* UnparsedSyntheticReference */; + node.kind === 285 /* UnparsedPrologue */ || + node.kind === 289 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 295 /* JSDocTypeExpression */; + return node.kind === 294 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296 /* JSDocAllType */; + return node.kind === 295 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297 /* JSDocUnknownType */; + return node.kind === 296 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298 /* JSDocNullableType */; + return node.kind === 297 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299 /* JSDocNonNullableType */; + return node.kind === 298 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300 /* JSDocOptionalType */; + return node.kind === 299 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301 /* JSDocFunctionType */; + return node.kind === 300 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302 /* JSDocVariadicType */; + return node.kind === 301 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304 /* JSDocComment */; + return node.kind === 303 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310 /* JSDocAuthorTag */; + return node.kind === 309 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308 /* JSDocAugmentsTag */; + return node.kind === 307 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309 /* JSDocImplementsTag */; + return node.kind === 308 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311 /* JSDocClassTag */; + return node.kind === 310 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312 /* JSDocPublicTag */; + return node.kind === 311 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313 /* JSDocPrivateTag */; + return node.kind === 312 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314 /* JSDocProtectedTag */; + return node.kind === 313 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315 /* JSDocReadonlyTag */; + return node.kind === 314 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317 /* JSDocEnumTag */; + return node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320 /* JSDocThisTag */; + return node.kind === 319 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318 /* JSDocParameterTag */; + return node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319 /* JSDocReturnTag */; + return node.kind === 318 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321 /* JSDocTypeTag */; + return node.kind === 320 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322 /* JSDocTemplateTag */; + return node.kind === 321 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323 /* JSDocTypedefTag */; + return node.kind === 322 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324 /* JSDocPropertyTag */; + return node.kind === 323 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; + return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305 /* JSDocTypeLiteral */; + return node.kind === 304 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316 /* JSDocCallbackTag */; + return node.kind === 315 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306 /* JSDocSignature */; + return node.kind === 305 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -12003,7 +12003,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 325 /* SyntaxList */; + return n.kind === 324 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12013,7 +12013,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 154 /* FirstNode */; + return kind >= 153 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12022,7 +12022,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12063,12 +12063,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.isTypeOnly; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12103,13 +12103,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12132,7 +12132,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 /* QualifiedName */ + return kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12142,14 +12142,14 @@ var ts; || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 155 /* ComputedPropertyName */; + || kind === 154 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 190 /* ObjectBindingPattern */ - || kind === 191 /* ArrayBindingPattern */; + || kind === 189 /* ObjectBindingPattern */ + || kind === 190 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12164,13 +12164,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: return false; @@ -12179,14 +12179,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 172 /* ConstructorType */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 171 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12201,29 +12201,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 160 /* PropertyDeclaration */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 168 /* IndexSignature */ - || kind === 223 /* SemicolonClassElement */; + return kind === 162 /* Constructor */ + || kind === 159 /* PropertyDeclaration */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 167 /* IndexSignature */ + || kind === 222 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); + return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); + return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; default: return false; @@ -12233,11 +12233,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 167 /* ConstructSignature */ - || kind === 166 /* CallSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */ - || kind === 168 /* IndexSignature */; + return kind === 166 /* ConstructSignature */ + || kind === 165 /* CallSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */ + || kind === 167 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12246,12 +12246,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 /* PropertyAssignment */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 284 /* SpreadAssignment */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 281 /* PropertyAssignment */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 283 /* SpreadAssignment */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12266,8 +12266,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return true; } return false; @@ -12278,8 +12278,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 /* ArrayBindingPattern */ - || kind === 190 /* ObjectBindingPattern */; + return kind === 190 /* ArrayBindingPattern */ + || kind === 189 /* ObjectBindingPattern */; } return false; } @@ -12287,15 +12287,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 /* ArrayLiteralExpression */ - || kind === 194 /* ObjectLiteralExpression */; + return kind === 192 /* ArrayLiteralExpression */ + || kind === 193 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 /* BindingElement */ - || kind === 216 /* OmittedExpression */; + return kind === 191 /* BindingElement */ + || kind === 215 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12304,9 +12304,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: return true; } return false; @@ -12327,8 +12327,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return true; } return false; @@ -12340,8 +12340,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return true; } return false; @@ -12350,26 +12350,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */ - || kind === 189 /* ImportType */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */ + || kind === 188 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: return true; default: return false; @@ -12377,12 +12377,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; + return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 /* TemplateExpression */ + return kind === 211 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12393,33 +12393,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 198 /* NewExpression */: - case 197 /* CallExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 199 /* TaggedTemplateExpression */: - case 193 /* ArrayLiteralExpression */: - case 201 /* ParenthesizedExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 198 /* TaggedTemplateExpression */: + case 192 /* ArrayLiteralExpression */: + case 200 /* ParenthesizedExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 219 /* NonNullExpression */: - case 220 /* MetaProperty */: + case 218 /* NonNullExpression */: + case 219 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12433,13 +12433,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 200 /* TypeAssertionExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 199 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12448,9 +12448,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12469,15 +12469,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: - case 203 /* ArrowFunction */: - case 210 /* BinaryExpression */: - case 214 /* SpreadElement */: - case 218 /* AsExpression */: - case 216 /* OmittedExpression */: - case 328 /* CommaListExpression */: - case 327 /* PartiallyEmittedExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: + case 202 /* ArrowFunction */: + case 209 /* BinaryExpression */: + case 213 /* SpreadElement */: + case 217 /* AsExpression */: + case 215 /* OmittedExpression */: + case 327 /* CommaListExpression */: + case 326 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12485,23 +12485,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 /* TypeAssertionExpression */ - || kind === 218 /* AsExpression */; + return kind === 199 /* TypeAssertionExpression */ + || kind === 217 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 327 /* PartiallyEmittedExpression */; + return node.kind === 326 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 326 /* NotEmittedStatement */; + return node.kind === 325 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 331 /* SyntheticReferenceExpression */; + return node.kind === 330 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12512,13 +12512,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12547,7 +12547,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; + return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12571,114 +12571,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */ + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */; + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 250 /* ModuleDeclaration */; + || kind === 249 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 /* NamedImports */ - || kind === 257 /* NamespaceImport */; + return kind === 257 /* NamedImports */ + || kind === 256 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; + return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 /* ArrowFunction */ - || kind === 192 /* BindingElement */ - || kind === 246 /* ClassDeclaration */ - || kind === 215 /* ClassExpression */ - || kind === 163 /* Constructor */ - || kind === 249 /* EnumDeclaration */ - || kind === 285 /* EnumMember */ - || kind === 264 /* ExportSpecifier */ - || kind === 245 /* FunctionDeclaration */ - || kind === 202 /* FunctionExpression */ - || kind === 164 /* GetAccessor */ - || kind === 256 /* ImportClause */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 259 /* ImportSpecifier */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 274 /* JsxAttribute */ - || kind === 162 /* MethodDeclaration */ - || kind === 161 /* MethodSignature */ - || kind === 250 /* ModuleDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 257 /* NamespaceImport */ - || kind === 263 /* NamespaceExport */ - || kind === 157 /* Parameter */ - || kind === 282 /* PropertyAssignment */ - || kind === 160 /* PropertyDeclaration */ - || kind === 159 /* PropertySignature */ - || kind === 165 /* SetAccessor */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 156 /* TypeParameter */ - || kind === 243 /* VariableDeclaration */ - || kind === 323 /* JSDocTypedefTag */ - || kind === 316 /* JSDocCallbackTag */ - || kind === 324 /* JSDocPropertyTag */; + return kind === 202 /* ArrowFunction */ + || kind === 191 /* BindingElement */ + || kind === 245 /* ClassDeclaration */ + || kind === 214 /* ClassExpression */ + || kind === 162 /* Constructor */ + || kind === 248 /* EnumDeclaration */ + || kind === 284 /* EnumMember */ + || kind === 263 /* ExportSpecifier */ + || kind === 244 /* FunctionDeclaration */ + || kind === 201 /* FunctionExpression */ + || kind === 163 /* GetAccessor */ + || kind === 255 /* ImportClause */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportSpecifier */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 273 /* JsxAttribute */ + || kind === 161 /* MethodDeclaration */ + || kind === 160 /* MethodSignature */ + || kind === 249 /* ModuleDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 256 /* NamespaceImport */ + || kind === 262 /* NamespaceExport */ + || kind === 156 /* Parameter */ + || kind === 281 /* PropertyAssignment */ + || kind === 159 /* PropertyDeclaration */ + || kind === 158 /* PropertySignature */ + || kind === 164 /* SetAccessor */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 155 /* TypeParameter */ + || kind === 242 /* VariableDeclaration */ + || kind === 322 /* JSDocTypedefTag */ + || kind === 315 /* JSDocCallbackTag */ + || kind === 323 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 265 /* MissingDeclaration */ - || kind === 246 /* ClassDeclaration */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 249 /* EnumDeclaration */ - || kind === 250 /* ModuleDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 260 /* ExportAssignment */ - || kind === 253 /* NamespaceExportDeclaration */; + return kind === 244 /* FunctionDeclaration */ + || kind === 264 /* MissingDeclaration */ + || kind === 245 /* ClassDeclaration */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 248 /* EnumDeclaration */ + || kind === 249 /* ModuleDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 259 /* ExportAssignment */ + || kind === 252 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 /* BreakStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 229 /* DoStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 225 /* EmptyStatement */ - || kind === 232 /* ForInStatement */ - || kind === 233 /* ForOfStatement */ - || kind === 231 /* ForStatement */ - || kind === 228 /* IfStatement */ - || kind === 239 /* LabeledStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 238 /* SwitchStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 241 /* TryStatement */ - || kind === 226 /* VariableStatement */ - || kind === 230 /* WhileStatement */ - || kind === 237 /* WithStatement */ - || kind === 326 /* NotEmittedStatement */ - || kind === 330 /* EndOfDeclarationMarker */ - || kind === 329 /* MergeDeclarationMarker */; + return kind === 234 /* BreakStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 228 /* DoStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 224 /* EmptyStatement */ + || kind === 231 /* ForInStatement */ + || kind === 232 /* ForOfStatement */ + || kind === 230 /* ForStatement */ + || kind === 227 /* IfStatement */ + || kind === 238 /* LabeledStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 237 /* SwitchStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 240 /* TryStatement */ + || kind === 225 /* VariableStatement */ + || kind === 229 /* WhileStatement */ + || kind === 236 /* WithStatement */ + || kind === 325 /* NotEmittedStatement */ + || kind === 329 /* EndOfDeclarationMarker */ + || kind === 328 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 156 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 155 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12705,10 +12705,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224 /* Block */) + if (node.kind !== 223 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { + if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { return false; } } @@ -12718,8 +12718,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 266 /* ExternalModuleReference */ - || kind === 154 /* QualifiedName */ + return kind === 265 /* ExternalModuleReference */ + || kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12729,70 +12729,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 195 /* PropertyAccessExpression */; + || kind === 194 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 267 /* JsxElement */ - || kind === 277 /* JsxExpression */ - || kind === 268 /* JsxSelfClosingElement */ + return kind === 266 /* JsxElement */ + || kind === 276 /* JsxExpression */ + || kind === 267 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 271 /* JsxFragment */; + || kind === 270 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 /* JsxAttribute */ - || kind === 276 /* JsxSpreadAttribute */; + return kind === 273 /* JsxAttribute */ + || kind === 275 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 277 /* JsxExpression */; + || kind === 276 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 /* JsxOpeningElement */ - || kind === 268 /* JsxSelfClosingElement */; + return kind === 268 /* JsxOpeningElement */ + || kind === 267 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 /* CaseClause */ - || kind === 279 /* DefaultClause */; + return kind === 277 /* CaseClause */ + || kind === 278 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; + return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; + return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12818,13 +12818,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: return true; default: return false; @@ -12832,12 +12832,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13132,7 +13132,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291 /* SourceFile */) { + while (node && node.kind !== 290 /* SourceFile */) { node = node.parent; } return node; @@ -13140,11 +13140,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return true; } return false; @@ -13339,7 +13339,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13464,7 +13464,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; + return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13496,11 +13496,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 && node.kind === 250 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 /* SourceFile */ || - node.kind === 250 /* ModuleDeclaration */ || + return node.kind === 290 /* SourceFile */ || + node.kind === 249 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13517,9 +13517,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node.parent); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13572,22 +13572,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 281 /* CatchClause */: - case 250 /* ModuleDeclaration */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 280 /* CatchClause */: + case 249 /* ModuleDeclaration */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 224 /* Block */: + case 223 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13597,9 +13597,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 306 /* JSDocSignature */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 305 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13609,25 +13609,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13637,8 +13637,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13647,15 +13647,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 226 /* VariableStatement */: - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 225 /* VariableStatement */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return true; default: return false; @@ -13692,7 +13692,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13708,9 +13708,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13771,7 +13771,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224 /* Block */) { + if (node.body && node.body.kind === 223 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13785,7 +13785,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13794,28 +13794,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: errorNode = node.name; break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13867,11 +13867,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13885,7 +13885,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 /* ExpressionStatement */ + return node.kind === 226 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13894,11 +13894,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 /* Parameter */ || - node.kind === 156 /* TypeParameter */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 203 /* ArrowFunction */ || - node.kind === 201 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 156 /* Parameter */ || + node.kind === 155 /* TypeParameter */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 202 /* ArrowFunction */ || + node.kind === 200 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13914,48 +13914,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 206 /* VoidExpression */; - case 217 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 205 /* VoidExpression */; + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156 /* TypeParameter */: - return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; + case 155 /* TypeParameter */: + return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 194 /* 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 === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 154 /* QualifiedName */: - case 195 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 173 /* TypeQuery */) { + if (parent.kind === 172 /* TypeQuery */) { return false; } - if (parent.kind === 189 /* ImportType */) { + if (parent.kind === 188 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13964,40 +13964,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return node === parent.constraint; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return node === parent.constraint; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return node === parent.type; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node === parent.type; - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return node === parent.type; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return node === parent.type; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14022,23 +14022,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitor(node); - case 252 /* CaseBlock */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 251 /* CaseBlock */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14048,23 +14048,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* 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(node.name.expression); @@ -14087,10 +14087,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 175 /* ArrayType */) { + if (node && node.kind === 174 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 170 /* TypeReference */) { + else if (node && node.kind === 169 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14100,12 +14100,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 174 /* TypeLiteral */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 173 /* TypeLiteral */: return node.members; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return node.properties; } } @@ -14113,14 +14113,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192 /* BindingElement */: - case 285 /* EnumMember */: - case 157 /* Parameter */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 284 /* EnumMember */: + case 156 /* Parameter */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 242 /* VariableDeclaration */: return true; } } @@ -14132,8 +14132,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ - && node.parent.parent.kind === 226 /* VariableStatement */; + return node.parent.kind === 243 /* VariableDeclarationList */ + && node.parent.parent.kind === 225 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14144,13 +14144,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return true; } return false; @@ -14161,7 +14161,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239 /* LabeledStatement */) { + if (node.statement.kind !== 238 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14169,17 +14169,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; + return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 /* MethodDeclaration */ && - (node.parent.kind === 194 /* ObjectLiteralExpression */ || - node.parent.kind === 215 /* ClassExpression */); + return node.kind === 161 /* MethodDeclaration */ && + (node.parent.kind === 193 /* ObjectLiteralExpression */ || + node.parent.kind === 214 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14192,7 +14192,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282 /* PropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14233,14 +14233,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291 /* SourceFile */); + ts.Debug.assert(node.kind !== 290 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* 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 @@ -14255,9 +14255,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14268,26 +14268,26 @@ var ts; node = node.parent; } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 250 /* ModuleDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 249 /* EnumDeclaration */: - case 291 /* SourceFile */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 249 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 248 /* EnumDeclaration */: + case 290 /* SourceFile */: return node; } } @@ -14297,9 +14297,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return container; } } @@ -14321,27 +14321,27 @@ var ts; return node; } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: node = node.parent; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14357,14 +14357,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { + if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 201 /* ParenthesizedExpression */) { + while (parent.kind === 200 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14380,7 +14380,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14389,20 +14389,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return node; } return undefined; @@ -14410,10 +14410,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return node.tag; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14426,25 +14426,25 @@ var ts; return false; } switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // classes are valid targets return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 246 /* ClassDeclaration */; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + return parent.kind === 245 /* ClassDeclaration */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 246 /* ClassDeclaration */; - case 157 /* Parameter */: + && parent.kind === 245 /* ClassDeclaration */; + case 156 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 163 /* Constructor */ - || parent.kind === 162 /* MethodDeclaration */ - || parent.kind === 165 /* SetAccessor */) - && grandparent.kind === 246 /* ClassDeclaration */; + && (parent.kind === 162 /* Constructor */ + || parent.kind === 161 /* MethodDeclaration */ + || parent.kind === 164 /* SetAccessor */) + && grandparent.kind === 245 /* ClassDeclaration */; } return false; } @@ -14460,10 +14460,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14472,9 +14472,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 /* JsxOpeningElement */ || - parent.kind === 268 /* JsxSelfClosingElement */ || - parent.kind === 270 /* JsxClosingElement */) { + if (parent.kind === 268 /* JsxOpeningElement */ || + parent.kind === 267 /* JsxSelfClosingElement */ || + parent.kind === 269 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14487,44 +14487,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 218 /* AsExpression */: - case 200 /* TypeAssertionExpression */: - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 210 /* BinaryExpression */: - case 211 /* ConditionalExpression */: - case 214 /* SpreadElement */: - case 212 /* TemplateExpression */: - case 216 /* OmittedExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 213 /* YieldExpression */: - case 207 /* AwaitExpression */: - case 220 /* MetaProperty */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 217 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 209 /* BinaryExpression */: + case 210 /* ConditionalExpression */: + case 213 /* SpreadElement */: + case 211 /* TemplateExpression */: + case 215 /* OmittedExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 212 /* YieldExpression */: + case 206 /* AwaitExpression */: + case 219 /* MetaProperty */: return true; - case 154 /* QualifiedName */: - while (node.parent.kind === 154 /* QualifiedName */) { + case 153 /* QualifiedName */: + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14542,49 +14542,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 191 /* BindingElement */: return parent.initializer === node; - case 227 /* ExpressionStatement */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 236 /* ReturnStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 240 /* ThrowStatement */: + case 226 /* ExpressionStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 235 /* ReturnStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 239 /* ThrowStatement */: return parent.expression === node; - case 231 /* ForStatement */: + case 230 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forInStatement.expression === node; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return node === parent.expression; - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return node === parent.expression; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return node === parent.expression; - case 158 /* Decorator */: - case 277 /* JsxExpression */: - case 276 /* JsxSpreadAttribute */: - case 284 /* SpreadAssignment */: + case 157 /* Decorator */: + case 276 /* JsxExpression */: + case 275 /* JsxSpreadAttribute */: + case 283 /* SpreadAssignment */: return true; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14592,14 +14592,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14608,7 +14608,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14640,11 +14640,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); + (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197 /* CallExpression */) { + if (callExpression.kind !== 196 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14776,11 +14776,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 202 /* FunctionExpression */ || - initializer.kind === 215 /* ClassExpression */ || - initializer.kind === 203 /* ArrowFunction */) { + if (initializer.kind === 201 /* FunctionExpression */ || + initializer.kind === 214 /* ClassExpression */ || + initializer.kind === 202 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15027,7 +15027,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15037,7 +15037,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15046,14 +15046,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.parent; - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return node.parent.parent; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 188 /* LiteralType */: + case 187 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15063,12 +15063,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.moduleSpecifier; - case 254 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 189 /* ImportType */: + case 253 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 188 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15077,11 +15077,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15089,7 +15089,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15110,13 +15110,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157 /* Parameter */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 283 /* ShorthandPropertyAssignment */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 282 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15130,7 +15130,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; + return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15155,12 +15155,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return node.initializer; } } @@ -15171,7 +15171,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 /* ModuleDeclaration */ + node.body.kind === 249 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15186,11 +15186,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156 /* TypeParameter */) { + if (node.kind === 155 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15201,10 +15201,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 /* PropertyAssignment */ || - parent.kind === 260 /* ExportAssignment */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || + if (parent.kind === 281 /* PropertyAssignment */ || + parent.kind === 259 /* ExportAssignment */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15278,7 +15278,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15295,31 +15295,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 201 /* ParenthesizedExpression */: - case 193 /* ArrayLiteralExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 192 /* ArrayLiteralExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: node = parent; break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15346,22 +15346,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224 /* Block */: - case 226 /* VariableStatement */: - case 237 /* WithStatement */: - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 223 /* Block */: + case 225 /* VariableStatement */: + case 236 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return true; } return false; @@ -15378,33 +15378,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183 /* ParenthesizedType */); + return walkUp(node, 182 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201 /* ParenthesizedExpression */); + return walkUp(node, 200 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { + while (node.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { + if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204 /* DeleteExpression */; + return node && node.kind === 203 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15457,7 +15454,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 /* ComputedPropertyName */ && + node.parent.kind === 154 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15465,32 +15462,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 195 /* PropertyAccessExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 194 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 154 /* QualifiedName */) { + while (parent.kind === 153 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; + return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; } return false; - case 192 /* BindingElement */: - case 259 /* ImportSpecifier */: + case 191 /* BindingElement */: + case 258 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 264 /* ExportSpecifier */: - case 274 /* JsxAttribute */: + case 263 /* ExportSpecifier */: + case 273 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15510,33 +15507,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 257 /* NamespaceImport */: - case 264 /* ExportSpecifier */: - case 260 /* ExportAssignment */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 256 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 259 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: return node.parent; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 154 /* QualifiedName */); + } while (node.parent.kind === 153 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15555,7 +15552,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : + return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15621,11 +15618,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15669,14 +15666,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15690,10 +15687,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15726,7 +15723,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { + if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15752,7 +15749,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15815,11 +15812,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157 /* Parameter */; + return root.kind === 156 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192 /* BindingElement */) { + while (node.kind === 191 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15827,15 +15824,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 202 /* FunctionExpression */ - || kind === 245 /* FunctionDeclaration */ - || kind === 203 /* ArrowFunction */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 250 /* ModuleDeclaration */ - || kind === 291 /* SourceFile */; + return kind === 162 /* Constructor */ + || kind === 201 /* FunctionExpression */ + || kind === 244 /* FunctionDeclaration */ + || kind === 202 /* ArrowFunction */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 249 /* ModuleDeclaration */ + || kind === 290 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15854,23 +15851,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: return 1 /* Right */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15894,15 +15891,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210 /* BinaryExpression */) { + if (expression.kind === 209 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { + else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15912,15 +15909,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return 0; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return 1; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return 2; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return 4; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15941,21 +15938,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: return 16; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return 17; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return 18; - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 19 : 18; - case 199 /* TaggedTemplateExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 198 /* TaggedTemplateExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15966,19 +15963,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 201 /* ParenthesizedExpression */: - case 216 /* OmittedExpression */: + case 211 /* TemplateExpression */: + case 200 /* ParenthesizedExpression */: + case 215 /* OmittedExpression */: return 20; default: return -1; @@ -16589,10 +16586,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 165 /* SetAccessor */) { + else if (accessor.kind === 164 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16612,10 +16609,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 /* GetAccessor */ && !getAccessor) { + if (member.kind === 163 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 165 /* SetAccessor */ && !setAccessor) { + if (member.kind === 164 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16664,7 +16661,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16888,7 +16885,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16930,11 +16927,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 131 /* DeclareKeyword */: return 2 /* Ambient */; + case 130 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16974,8 +16971,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 194 /* ObjectLiteralExpression */ - || kind === 193 /* ArrayLiteralExpression */; + return kind === 193 /* ObjectLiteralExpression */ + || kind === 192 /* ArrayLiteralExpression */; } return false; } @@ -16992,12 +16989,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -17007,8 +17004,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17038,17 +17035,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 /* ObjectLiteralExpression */ && + return expression.kind === 193 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 /* ArrayLiteralExpression */ && + return expression.kind === 192 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17372,8 +17369,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17450,35 +17447,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return accessKind(parent); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 282 /* PropertyAssignment */: { + case 281 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17627,39 +17624,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) + return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 149 /* UnknownKeyword */ - || kind === 141 /* NumberKeyword */ - || kind === 152 /* BigIntKeyword */ - || kind === 142 /* ObjectKeyword */ - || kind === 129 /* BooleanKeyword */ - || kind === 144 /* StringKeyword */ - || kind === 145 /* SymbolKeyword */ + || kind === 148 /* UnknownKeyword */ + || kind === 140 /* NumberKeyword */ + || kind === 151 /* BigIntKeyword */ + || kind === 141 /* ObjectKeyword */ + || kind === 128 /* BooleanKeyword */ + || kind === 143 /* StringKeyword */ + || kind === 144 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 147 /* UndefinedKeyword */ + || kind === 146 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 138 /* NeverKeyword */ - || kind === 217 /* ExpressionWithTypeArguments */ - || kind === 296 /* JSDocAllType */ - || kind === 297 /* JSDocUnknownType */ - || kind === 298 /* JSDocNullableType */ - || kind === 299 /* JSDocNonNullableType */ - || kind === 300 /* JSDocOptionalType */ - || kind === 301 /* JSDocFunctionType */ - || kind === 302 /* JSDocVariadicType */; + || kind === 137 /* NeverKeyword */ + || kind === 216 /* ExpressionWithTypeArguments */ + || kind === 295 /* JSDocAllType */ + || kind === 296 /* JSDocUnknownType */ + || kind === 297 /* JSDocNullableType */ + || kind === 298 /* JSDocNonNullableType */ + || kind === 299 /* JSDocOptionalType */ + || kind === 300 /* JSDocFunctionType */ + || kind === 301 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195 /* PropertyAccessExpression */) { + if (node.kind === 194 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17674,7 +17671,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; + return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18758,21 +18755,21 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; + return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { @@ -18780,16 +18777,16 @@ var ts; return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return true; - case 195 /* PropertyAccessExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 194 /* PropertyAccessExpression */: + case 216 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18809,7 +18806,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291 /* SourceFile */) { + if (kind === 290 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18864,19 +18861,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153 /* LastToken */) { + if (!node || node.kind <= 152 /* LastToken */) { return; } switch (node.kind) { - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18884,9 +18881,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18894,7 +18891,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18902,51 +18899,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18958,359 +18955,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 176 /* TupleType */: + case 175 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182 /* InferType */: + case 181 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 189 /* ImportType */: + case 188 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183 /* ParenthesizedType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 184 /* TypeOperator */: return visitNode(cbNode, node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187 /* MappedType */: + case 186 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return visitNode(cbNode, node.literal); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitNode(cbNode, node.name); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return visitNode(cbNode, node.label); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158 /* Decorator */: + case 157 /* Decorator */: return visitNode(cbNode, node.expression); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 177 /* OptionalType */: - case 178 /* RestType */: - case 295 /* JSDocTypeExpression */: - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 300 /* JSDocOptionalType */: - case 302 /* JSDocVariadicType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 294 /* JSDocTypeExpression */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 299 /* JSDocOptionalType */: + case 301 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310 /* JSDocAuthorTag */: + case 309 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 /* JSDocTypeExpression */ + node.typeExpression.kind === 294 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307 /* JSDocTag */: - case 311 /* JSDocClassTag */: - case 312 /* JSDocPublicTag */: - case 313 /* JSDocPrivateTag */: - case 314 /* JSDocProtectedTag */: - case 315 /* JSDocReadonlyTag */: + case 306 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 311 /* JSDocPublicTag */: + case 312 /* JSDocPrivateTag */: + case 313 /* JSDocProtectedTag */: + case 314 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19599,7 +19596,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227 /* ExpressionStatement */); + var statement = createNode(226 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19751,7 +19748,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -20083,7 +20080,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 226 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20195,7 +20192,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(155 /* ComputedPropertyName */); + var node = createNode(154 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20237,15 +20234,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146 /* TypeKeyword */) { + if (token() === 145 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20655,20 +20652,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163 /* Constructor */: - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 223 /* SemicolonClassElement */: + case 162 /* Constructor */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 222 /* SemicolonClassElement */: return true; - case 162 /* MethodDeclaration */: + case 161 /* 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 === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20677,8 +20674,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return true; } } @@ -20687,58 +20684,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 226 /* VariableStatement */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 227 /* ExpressionStatement */: - case 240 /* ThrowStatement */: - case 236 /* ReturnStatement */: - case 238 /* SwitchStatement */: - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 225 /* EmptyStatement */: - case 241 /* TryStatement */: - case 239 /* LabeledStatement */: - case 229 /* DoStatement */: - case 242 /* DebuggerStatement */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 225 /* VariableStatement */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 226 /* ExpressionStatement */: + case 239 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 237 /* SwitchStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 224 /* EmptyStatement */: + case 240 /* TryStatement */: + case 238 /* LabeledStatement */: + case 228 /* DoStatement */: + case 241 /* DebuggerStatement */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 159 /* PropertySignature */: - case 166 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 158 /* PropertySignature */: + case 165 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243 /* VariableDeclaration */) { + if (node.kind !== 242 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20759,7 +20756,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157 /* Parameter */) { + if (node.kind !== 156 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20898,7 +20895,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154 /* QualifiedName */, entity.pos); + var node = createNode(153 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20939,7 +20936,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212 /* TemplateExpression */); + var template = createNode(211 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20951,7 +20948,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222 /* TemplateSpan */); + var span = createNode(221 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -21017,7 +21014,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -21027,14 +21024,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: { + case 170 /* FunctionType */: + case 171 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -21042,20 +21039,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169 /* TypePredicate */, lhs.pos); + var node = createNode(168 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184 /* ThisType */); + var node = createNode(183 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296 /* JSDocAllType */); + var result = createNode(295 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(300 /* JSDocOptionalType */, result); + return createPostfixType(299 /* JSDocOptionalType */, result); } else { nextToken(); @@ -21063,7 +21060,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299 /* JSDocNonNullableType */); + var result = createNode(298 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -21087,28 +21084,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(297 /* JSDocUnknownType */, pos); + var result = createNode(296 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(298 /* JSDocNullableType */, pos); + var result = createNode(297 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157 /* Parameter */); + var parameter = createNode(156 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -21118,9 +21115,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -21139,23 +21136,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(300 /* JSDocOptionalType */, type); + return createPostfixType(299 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(173 /* TypeQuery */); + var node = createNode(172 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21200,7 +21197,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157 /* Parameter */); + var node = createNodeWithJSDoc(156 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21301,7 +21298,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167 /* ConstructSignature */) { + if (kind === 166 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21362,7 +21359,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 168 /* IndexSignature */; + node.kind = 167 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21372,13 +21369,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 161 /* MethodSignature */; + node.kind = 160 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 159 /* PropertySignature */; + node.kind = 158 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21424,10 +21421,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(166 /* CallSignature */); + return parseSignatureMember(165 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167 /* ConstructSignature */); + return parseSignatureMember(166 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21453,7 +21450,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174 /* TypeLiteral */); + var node = createNode(173 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21471,27 +21468,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 139 /* ReadonlyKeyword */; + return nextToken() === 138 /* ReadonlyKeyword */; } - if (token() === 139 /* ReadonlyKeyword */) { + if (token() === 138 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187 /* MappedType */); + var node = createNode(186 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { - parseExpectedToken(139 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + parseExpectedToken(138 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21511,23 +21508,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(178 /* RestType */, pos); + var node = createNode(177 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 177 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 176 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(176 /* TupleType */); + var node = createNode(175 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183 /* ParenthesizedType */); + var node = createNode(182 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21535,7 +21532,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21545,10 +21542,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188 /* LiteralType */); + var node = createNode(187 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21569,7 +21566,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(189 /* ImportType */); + var node = createNode(188 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21592,15 +21589,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 145 /* SymbolKeyword */: - case 129 /* BooleanKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 144 /* SymbolKeyword */: + case 128 /* BooleanKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21631,7 +21628,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21657,20 +21654,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 139 /* ReadonlyKeyword */: - case 145 /* SymbolKeyword */: - case 148 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 138 /* ReadonlyKeyword */: + case 144 /* SymbolKeyword */: + case 147 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21682,12 +21679,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21712,26 +21709,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(299 /* JSDocNonNullableType */, type); + type = createPostfixType(298 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298 /* JSDocNullableType */, type); + type = createPostfixType(297 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(186 /* IndexedAccessType */, type.pos); + var node = createNode(185 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(175 /* ArrayType */, type.pos); + var node = createNode(174 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21750,16 +21747,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185 /* TypeOperator */); + var node = createNode(184 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182 /* InferType */); - parseExpected(133 /* InferKeyword */); - var typeParameter = createNode(156 /* TypeParameter */); + var node = createNode(181 /* InferType */); + parseExpected(132 /* InferKeyword */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21767,12 +21764,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135 /* KeyOfKeyword */: - case 148 /* UniqueKeyword */: - case 139 /* ReadonlyKeyword */: - case 128 /* AwaitedKeyword */: + case 134 /* KeyOfKeyword */: + case 147 /* UniqueKeyword */: + case 138 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21793,10 +21789,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21853,7 +21849,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21865,16 +21861,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169 /* TypePredicate */); + var node = createNode(168 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21888,7 +21884,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(181 /* ConditionalType */, type.pos); + var node = createNode(180 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -22083,7 +22079,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213 /* YieldExpression */); + var node = createNode(212 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -22105,13 +22101,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203 /* ArrowFunction */, asyncModifier.pos); + node = createNode(202 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203 /* ArrowFunction */, identifier.pos); + node = createNode(202 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(157 /* Parameter */, identifier.pos); + var parameter = createNode(156 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22316,7 +22312,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203 /* ArrowFunction */); + var node = createNodeWithJSDoc(202 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22382,7 +22378,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22397,7 +22393,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22462,39 +22458,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210 /* BinaryExpression */, left.pos); + var node = createNode(209 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218 /* AsExpression */, left.pos); + var node = createNode(217 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204 /* DeleteExpression */); + var node = createNode(203 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205 /* TypeOfExpression */); + var node = createNode(204 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206 /* VoidExpression */); + var node = createNode(205 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22510,7 +22506,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207 /* AwaitExpression */); + var node = createNode(206 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22554,7 +22550,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { parseErrorAt(pos, end, 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 { @@ -22651,7 +22647,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22664,7 +22660,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22720,7 +22716,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(220 /* MetaProperty */, fullStart); + var node = createNode(219 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22803,7 +22799,7 @@ var ts; } // 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(195 /* PropertyAccessExpression */, expression.pos); + var node = createNode(194 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22813,8 +22809,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269 /* JsxOpeningElement */) { - var node = createNode(267 /* JsxElement */, opening.pos); + if (opening.kind === 268 /* JsxOpeningElement */) { + var node = createNode(266 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22823,15 +22819,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272 /* JsxOpeningFragment */) { - var node = createNode(271 /* JsxFragment */, opening.pos); + else if (opening.kind === 271 /* JsxOpeningFragment */) { + var node = createNode(270 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22846,7 +22842,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210 /* BinaryExpression */, result.pos); + var badNode = createNode(209 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22909,7 +22905,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275 /* JsxAttributes */); + var jsxAttributes = createNode(274 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22918,7 +22914,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22930,7 +22926,7 @@ var ts; // 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(269 /* JsxOpeningElement */, fullStart); + node = createNode(268 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22942,7 +22938,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(268 /* JsxSelfClosingElement */, fullStart); + node = createNode(267 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22959,7 +22955,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22967,7 +22963,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277 /* JsxExpression */); + var node = createNode(276 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22993,7 +22989,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274 /* JsxAttribute */); + var node = createNode(273 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -23008,7 +23004,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276 /* JsxSpreadAttribute */); + var node = createNode(275 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -23016,7 +23012,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270 /* JsxClosingElement */); + var node = createNode(269 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -23029,7 +23025,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273 /* JsxClosingFragment */); + var node = createNode(272 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -23044,7 +23040,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200 /* TypeAssertionExpression */); + var node = createNode(199 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -23061,12 +23057,33 @@ var ts; return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32 /* OptionalChain */) { + return true; + } + // check for an optional chain in a non-null expression + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + expr = expr.expression; + } + if (expr.flags & 32 /* OptionalChain */) { + // this is part of an optional chain. Walk down from `node` to `expression` and set the flag. + while (ts.isNonNullExpression(node)) { + node.flags |= 32 /* OptionalChain */; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32 /* OptionalChain */; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -23075,7 +23092,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -23089,7 +23106,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32 /* OptionalChain */; } return finishNode(indexedAccess); @@ -23111,7 +23128,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -23132,7 +23149,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -23160,12 +23177,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23173,11 +23190,11 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23185,7 +23202,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23304,28 +23321,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214 /* SpreadElement */); + var node = createNode(213 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193 /* ArrayLiteralExpression */); + var node = createNode(192 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23337,17 +23354,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 284 /* SpreadAssignment */; + node.kind = 283 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23365,7 +23382,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 283 /* ShorthandPropertyAssignment */; + node.kind = 282 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23373,14 +23390,14 @@ var ts; } } else { - node.kind = 282 /* PropertyAssignment */; + node.kind = 281 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194 /* ObjectLiteralExpression */); + var node = createNode(193 /* ObjectLiteralExpression */); var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { @@ -23405,7 +23422,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(202 /* FunctionExpression */); + var node = createNodeWithJSDoc(201 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23430,7 +23447,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(220 /* MetaProperty */, fullStart); + var node_2 = createNode(219 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23447,7 +23464,7 @@ var ts; } break; } - var node = createNode(198 /* NewExpression */, fullStart); + var node = createNode(197 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23457,7 +23474,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224 /* Block */); + var node = createNode(223 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23496,12 +23513,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225 /* EmptyStatement */); + var node = createNode(224 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(228 /* IfStatement */); + var node = createNode(227 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23511,7 +23528,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229 /* DoStatement */); + var node = createNode(228 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23526,7 +23543,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230 /* WhileStatement */); + var node = createNode(229 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23549,8 +23566,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { - var forOfStatement = createNode(233 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { + var forOfStatement = createNode(232 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23558,14 +23575,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(232 /* ForInStatement */, pos); + var forInStatement = createNode(231 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231 /* ForStatement */, pos); + var forStatement = createNode(230 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23583,7 +23600,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23591,7 +23608,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236 /* ReturnStatement */); + var node = createNode(235 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23600,7 +23617,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237 /* WithStatement */); + var node = createNode(236 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23609,7 +23626,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278 /* CaseClause */); + var node = createNode(277 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23617,7 +23634,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279 /* DefaultClause */); + var node = createNode(278 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23627,12 +23644,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238 /* SwitchStatement */); + var node = createNode(237 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(252 /* CaseBlock */); + var caseBlock = createNode(251 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23647,7 +23664,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(240 /* ThrowStatement */); + var node = createNode(239 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23655,7 +23672,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(241 /* TryStatement */); + var node = createNode(240 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23668,7 +23685,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281 /* CatchClause */); + var result = createNode(280 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23682,7 +23699,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242 /* DebuggerStatement */); + var node = createNode(241 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23691,15 +23708,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 226 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 239 /* LabeledStatement */; + node.kind = 238 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227 /* ExpressionStatement */; + node.kind = 226 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23753,25 +23770,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23780,7 +23797,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 146 /* TypeKeyword */) { + if (currentToken_1 === 145 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23834,19 +23851,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 146 /* TypeKeyword */: - case 151 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 145 /* TypeKeyword */: + case 150 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23870,16 +23887,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23889,9 +23906,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(234 /* ContinueStatement */); + return parseBreakOrContinueStatement(233 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(235 /* BreakStatement */); + return parseBreakOrContinueStatement(234 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23912,10 +23929,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 131 /* DeclareKeyword */: + case 145 /* TypeKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23925,8 +23942,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: - case 151 /* GlobalKeyword */: + case 138 /* ReadonlyKeyword */: + case 150 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23935,7 +23952,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131 /* DeclareKeyword */; + return modifier.kind === 130 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23983,13 +24000,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 151 /* GlobalKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 150 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -24008,7 +24025,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -24031,16 +24048,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(216 /* OmittedExpression */); + return createNode(215 /* OmittedExpression */); } - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -24056,14 +24073,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190 /* ObjectBindingPattern */); + var node = createNode(189 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191 /* ArrayBindingPattern */); + var node = createNode(190 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -24088,7 +24105,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243 /* VariableDeclaration */); + var node = createNode(242 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -24101,7 +24118,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244 /* VariableDeclarationList */); + var node = createNode(243 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -24124,7 +24141,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -24139,13 +24156,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 226 /* VariableStatement */; + node.kind = 225 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245 /* FunctionDeclaration */; + node.kind = 244 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -24156,8 +24173,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130 /* ConstructorKeyword */) { - return parseExpected(130 /* ConstructorKeyword */); + if (token() === 129 /* ConstructorKeyword */) { + return parseExpected(129 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -24169,7 +24186,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163 /* Constructor */; + node.kind = 162 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -24177,7 +24194,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162 /* MethodDeclaration */; + node.kind = 161 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -24186,7 +24203,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160 /* PropertyDeclaration */; + node.kind = 159 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24248,7 +24265,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24280,7 +24297,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(158 /* Decorator */, decoratorStart); + var decorator = createNode(157 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24330,20 +24347,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(223 /* SemicolonClassElement */); + var result = createNode(222 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } - if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24380,10 +24397,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24426,14 +24443,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(280 /* HeritageClause */); + var node = createNode(279 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24449,7 +24466,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247 /* InterfaceDeclaration */; + node.kind = 246 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24458,8 +24475,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248 /* TypeAliasDeclaration */; - parseExpected(146 /* TypeKeyword */); + node.kind = 247 /* TypeAliasDeclaration */; + parseExpected(145 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24472,13 +24489,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(285 /* EnumMember */); + var node = createNodeWithJSDoc(284 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249 /* EnumDeclaration */; + node.kind = 248 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24491,7 +24508,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251 /* ModuleBlock */); + var node = createNode(250 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24502,7 +24519,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250 /* ModuleDeclaration */; + node.kind = 249 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24514,8 +24531,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250 /* ModuleDeclaration */; - if (token() === 151 /* GlobalKeyword */) { + node.kind = 249 /* ModuleDeclaration */; + if (token() === 150 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24534,15 +24551,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151 /* GlobalKeyword */) { + if (token() === 150 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137 /* NamespaceKeyword */)) { + else if (parseOptional(136 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(136 /* ModuleKeyword */); + parseExpected(135 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24550,7 +24567,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 /* RequireKeyword */ && + return token() === 139 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24560,9 +24577,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 253 /* NamespaceExportDeclaration */; + node.kind = 252 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(137 /* NamespaceKeyword */); + parseExpected(136 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24575,7 +24592,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 /* FromKeyword */ && + if (token() !== 149 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24585,7 +24602,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 255 /* ImportDeclaration */; + node.kind = 254 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24594,7 +24611,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24606,10 +24623,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254 /* ImportEqualsDeclaration */; + node.kind = 253 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24627,7 +24644,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(256 /* ImportClause */, fullStart); + var importClause = createNode(255 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24638,7 +24655,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); } return finishNode(importClause); } @@ -24648,8 +24665,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(266 /* ExternalModuleReference */); - parseExpected(140 /* RequireKeyword */); + var node = createNode(265 /* ExternalModuleReference */); + parseExpected(139 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24671,7 +24688,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(257 /* NamespaceImport */); + var namespaceImport = createNode(256 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24686,14 +24703,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264 /* ExportSpecifier */); + return parseImportOrExportSpecifier(263 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259 /* ImportSpecifier */); + return parseImportOrExportSpecifier(258 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24718,34 +24735,34 @@ var ts; else { node.name = identifierName; } - if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263 /* NamespaceExport */, pos); + var node = createNode(262 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(146 /* TypeKeyword */); + node.kind = 260 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(145 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(150 /* FromKeyword */); + if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24753,7 +24770,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260 /* ExportAssignment */; + node.kind = 259 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24773,10 +24790,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ - || node.kind === 255 /* ImportDeclaration */ - || node.kind === 260 /* ExportAssignment */ - || node.kind === 261 /* ExportDeclaration */ ? node : undefined; + || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ + || node.kind === 254 /* ImportDeclaration */ + || node.kind === 259 /* ExportAssignment */ + || node.kind === 260 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24842,7 +24859,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295 /* JSDocTypeExpression */); + var result = createNode(294 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -25005,7 +25022,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304 /* JSDocComment */, start); + var result = createNode(303 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -25075,19 +25092,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25222,7 +25239,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307 /* JSDocTag */, start); + var result = createNode(306 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25267,9 +25284,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25285,8 +25302,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(324 /* JSDocPropertyTag */, start) : - createNode(318 /* JSDocParameterTag */, start); + createNode(323 /* JSDocPropertyTag */, start) : + createNode(317 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25303,20 +25320,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { + if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25328,7 +25345,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319 /* JSDocReturnTag */, start); + var result = createNode(318 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25337,13 +25354,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321 /* JSDocTypeTag */, start); + var result = createNode(320 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310 /* JSDocAuthorTag */, start); + var result = createNode(309 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25397,20 +25414,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309 /* JSDocImplementsTag */, start); + var result = createNode(308 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308 /* JSDocAugmentsTag */, start); + var result = createNode(307 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25422,7 +25439,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(195 /* PropertyAccessExpression */, node.pos); + var prop = createNode(194 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25435,14 +25452,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320 /* JSDocThisTag */, start); + var tag = createNode(319 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317 /* JSDocEnumTag */, start); + var tag = createNode(316 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25451,7 +25468,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323 /* JSDocTypedefTag */, start); + var typedefTag = createNode(322 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25465,9 +25482,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); } - if (child.kind === 321 /* JSDocTypeTag */) { + if (child.kind === 320 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25480,7 +25497,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25499,7 +25516,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25513,14 +25530,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316 /* JSDocCallbackTag */, start); + var callbackTag = createNode(315 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306 /* JSDocSignature */, start); + var jsdocSignature = createNode(305 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25528,7 +25545,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 319 /* JSDocReturnTag */) { + if (tag && tag.kind === 318 /* JSDocReturnTag */) { return tag; } } @@ -25573,7 +25590,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && + if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25637,13 +25654,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156 /* TypeParameter */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(322 /* JSDocTemplateTag */, start); + var result = createNode(321 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -27952,7 +27969,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282 /* PropertyAssignment */) { + if (element.kind !== 281 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -28043,13 +28060,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -28066,7 +28083,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30494,26 +30511,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30529,7 +30546,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 251 /* ModuleBlock */: { + case 250 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30551,7 +30568,7 @@ var ts; }); return state_1; } - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30759,7 +30776,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 260 /* ExportAssignment */) { + if (node.kind === 259 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30768,7 +30785,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30796,36 +30813,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "__constructor" /* Constructor */; - case 171 /* FunctionType */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: return "__call" /* Call */; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return "__new" /* New */; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "__index" /* Index */; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 157 /* Parameter */: + case 156 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30925,7 +30942,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30964,7 +30981,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -31031,7 +31048,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -31064,7 +31081,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -31079,13 +31096,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -31129,8 +31146,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -31162,90 +31179,93 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: bindWhileStatement(node); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: bindDoStatement(node); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: bindForStatement(node); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: bindIfStatement(node); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: bindTryStatement(node); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: bindSwitchStatement(node); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: bindCaseBlock(node); break; - case 278 /* CaseClause */: + case 277 /* CaseClause */: bindCaseClause(node); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: bindLabeledStatement(node); break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: bindCallExpressionFlow(node); break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 218 /* NonNullExpression */: + bindNonNullExpressionFlow(node); + break; + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 291 /* SourceFile */: { + case 290 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31258,18 +31278,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return hasNarrowableArgument(expr); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31291,7 +31311,7 @@ var ts; } } } - if (expr.expression.kind === 195 /* PropertyAccessExpression */ && + if (expr.expression.kind === 194 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31324,9 +31344,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31402,26 +31422,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return parent.expression === node; - case 231 /* ForStatement */: - case 211 /* ConditionalExpression */: + case 230 /* ForStatement */: + case 210 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201 /* ParenthesizedExpression */) { + if (node.kind === 200 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31463,7 +31483,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239 /* LabeledStatement */) { + while (label && node.parent.kind === 238 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31514,12 +31534,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233 /* ForOfStatement */) { + if (node.kind === 232 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244 /* VariableDeclarationList */) { + if (node.initializer.kind !== 243 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31541,7 +31561,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236 /* ReturnStatement */) { + if (node.kind === 235 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31558,7 +31578,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31658,7 +31678,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31707,7 +31727,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 197 /* CallExpression */) { + if (node.expression.kind === 196 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31733,7 +31753,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31744,10 +31764,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 193 /* ArrayLiteralExpression */) { + else if (node.kind === 192 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214 /* SpreadElement */) { + if (e.kind === 213 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31755,16 +31775,16 @@ var ts; } } } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282 /* PropertyAssignment */) { + if (p.kind === 281 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283 /* ShorthandPropertyAssignment */) { + else if (p.kind === 282 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284 /* SpreadAssignment */) { + else if (p.kind === 283 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31886,7 +31906,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31948,7 +31968,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31987,14 +32007,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162 /* MethodDeclaration */) { + if (host && host.kind !== 161 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -32006,15 +32026,17 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: + bind(node.questionDotToken); bind(node.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -32032,7 +32054,7 @@ var ts; // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest // of the node as part of the "true" branch, and continue to do so as we ascend back up to the outermost // chain node. We then treat the entire node as the right side of the expression. - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -32053,6 +32075,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -32070,7 +32100,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { + if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -32079,7 +32109,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -32088,54 +32118,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 275 /* JsxAttributes */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 274 /* JsxAttributes */: return 1 /* IsContainer */; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 301 /* JSDocFunctionType */: - case 171 /* FunctionType */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 172 /* ConstructorType */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 300 /* JSDocFunctionType */: + case 170 /* FunctionType */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 171 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 281 /* CatchClause */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 252 /* CaseBlock */: + case 280 /* CatchClause */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 251 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 224 /* Block */: + case 223 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -32168,45 +32198,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 194 /* ObjectLiteralExpression */: - case 247 /* InterfaceDeclaration */: - case 275 /* JsxAttributes */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 193 /* ObjectLiteralExpression */: + case 246 /* InterfaceDeclaration */: + case 274 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 306 /* JSDocSignature */: - case 168 /* IndexSignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 301 /* JSDocFunctionType */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 305 /* JSDocSignature */: + case 167 /* IndexSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 300 /* JSDocFunctionType */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32307,7 +32337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32319,7 +32349,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ + var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32351,10 +32381,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32540,8 +32570,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 291 /* SourceFile */ && - blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 290 /* SourceFile */ && + blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32636,7 +32666,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 153 /* LastToken */) { + if (node.kind > 152 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32712,14 +32742,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32734,7 +32764,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32762,78 +32792,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return checkStrictModeCatchClause(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkStrictModeWithStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 184 /* ThisType */: + case 183 /* ThisType */: seenThisKeyword = true; return; - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: break; // Binding the children will handle everything - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return bindTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return bindParameter(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return bindPropertyWorker(node); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: + case 171 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 187 /* MappedType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 186 /* MappedType */: return bindAnonymousTypeWorker(node); - case 311 /* JSDocClassTag */: + case 310 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return bindFunctionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32852,65 +32882,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return bindJsxAttributes(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return bindImportClause(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return bindExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return bindExportAssignment(node); - case 291 /* SourceFile */: + case 290 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224 /* Block */: + case 223 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 318 /* JSDocParameterTag */: - if (node.parent.kind === 306 /* JSDocSignature */) { + case 317 /* JSDocParameterTag */: + if (node.parent.kind === 305 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { break; } // falls through - case 324 /* JSDocPropertyTag */: + case 323 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -33066,8 +33096,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -33089,11 +33119,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -33105,7 +33135,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -33135,7 +33165,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -33175,7 +33205,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33277,8 +33307,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ - : propertyAccess.parent.parent.kind === 291 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ + : propertyAccess.parent.parent.kind === 290 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33357,7 +33387,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246 /* ClassDeclaration */) { + if (node.kind === 245 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33420,7 +33450,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { + if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33497,7 +33527,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 182 /* InferType */) { + else if (node.parent.kind === 181 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33525,11 +33555,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || // report error on class declarations - node.kind === 246 /* ClassDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33573,12 +33603,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33627,58 +33657,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 157 /* Parameter */: + case 156 /* Parameter */: return computeParameter(node, subtreeFlags); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163 /* Constructor */: + case 162 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33729,12 +33759,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33782,8 +33812,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 218 /* AsExpression */ - || expressionKind === 200 /* TypeAssertionExpression */) { + if (expressionKind === 217 /* AsExpression */ + || expressionKind === 199 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -34131,13 +34161,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -34146,27 +34176,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 219 /* NonNullExpression */: - case 139 /* ReadonlyKeyword */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 218 /* NonNullExpression */: + case 138 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: case 11 /* JsxText */: - case 270 /* JsxClosingElement */: - case 271 /* JsxFragment */: - case 272 /* JsxOpeningFragment */: - case 273 /* JsxClosingFragment */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 277 /* JsxExpression */: + case 269 /* JsxClosingElement */: + case 270 /* JsxFragment */: + case 271 /* JsxOpeningFragment */: + case 272 /* JsxClosingFragment */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 276 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -34179,16 +34209,16 @@ var ts; break; } // falls through - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 212 /* TemplateExpression */: - case 283 /* ShorthandPropertyAssignment */: + case 211 /* TemplateExpression */: + case 282 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34205,70 +34235,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 169 /* TypePredicate */: - case 170 /* TypeReference */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 173 /* TypeQuery */: - case 174 /* TypeLiteral */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 182 /* InferType */: - case 183 /* ParenthesizedType */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: - case 253 /* NamespaceExportDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 168 /* TypePredicate */: + case 169 /* TypeReference */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 172 /* TypeQuery */: + case 173 /* TypeLiteral */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 181 /* InferType */: + case 182 /* ParenthesizedType */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: + case 252 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34280,28 +34310,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34314,29 +34344,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34357,67 +34387,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { + if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 193 /* ArrayLiteralExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 192 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 157 /* Parameter */: + case 156 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 163 /* Constructor */: + case 162 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 144 /* StringKeyword */: - case 142 /* ObjectKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 143 /* StringKeyword */: + case 141 /* ObjectKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 281 /* CatchClause */: + case 280 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: - case 201 /* ParenthesizedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: + case 200 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34592,7 +34622,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 173 /* TypeQuery */) { + if (d.type && d.type.kind === 172 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35234,7 +35264,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35800,7 +35829,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35858,17 +35887,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 192 /* BindingElement */) { + if (declaration.kind === 191 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); } - else if (declaration.kind === 243 /* VariableDeclaration */) { + else if (declaration.kind === 242 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35899,12 +35928,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35924,9 +35953,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226 /* VariableStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 225 /* VariableStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35947,16 +35976,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 /* PropertyDeclaration */ && + current.parent.kind === 159 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 162 /* MethodDeclaration */) { + if (declaration.kind === 161 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35978,19 +36007,19 @@ var ts; return "quit"; } switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224 /* Block */: + case 223 /* Block */: switch (node.parent.kind) { - case 164 /* GetAccessor */: - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return true; default: return false; @@ -36036,12 +36065,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 157 /* Parameter */ || - lastLocation.kind === 156 /* TypeParameter */ + lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 155 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -36058,13 +36087,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181 /* ConditionalType */) { + else if (location.kind === 180 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -36079,14 +36108,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -36110,7 +36139,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { break; } } @@ -36124,12 +36153,12 @@ var ts; } } break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -36146,9 +36175,9 @@ var ts; } } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -36167,7 +36196,7 @@ var ts; } break loop; } - if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36175,7 +36204,7 @@ var ts; } } break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -36195,9 +36224,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36205,24 +36234,24 @@ var ts; } } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36235,7 +36264,7 @@ var ts; } } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36244,7 +36273,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 157 /* Parameter */) { + if (location.parent && location.parent.kind === 156 /* Parameter */) { location = location.parent; } // @@ -36259,25 +36288,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { location = location.parent; } break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 157 /* Parameter */: + case 156 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157 /* Parameter */) { + if (root.kind === 156 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36297,7 +36326,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36414,10 +36443,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { + if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36430,12 +36459,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: // For `namespace N { N; }` + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36447,7 +36476,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156 /* TypeParameter */) { + if (decl.kind === 155 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36503,9 +36532,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36549,7 +36578,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36608,7 +36637,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36643,13 +36672,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36673,28 +36702,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36995,28 +37024,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 260 /* ExportAssignment */: - case 210 /* BinaryExpression */: + case 259 /* ExportAssignment */: + case 209 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -37168,13 +37197,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -37198,9 +37227,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { - var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { + var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37235,7 +37264,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37457,7 +37486,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37744,7 +37773,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37831,12 +37860,12 @@ var ts; } } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37845,9 +37874,9 @@ var ts; return { value: result }; } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37930,7 +37959,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37974,7 +38003,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37989,10 +38018,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: continue; default: return false; @@ -38123,10 +38152,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38173,14 +38202,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 173 /* TypeQuery */ || + if (entityName.parent.kind === 172 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155 /* ComputedPropertyName */) { + entityName.parent.kind === 154 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || - entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || + entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38229,10 +38258,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38352,23 +38381,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* StringKeyword */); + return ts.createKeywordTypeNode(143 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* NumberKeyword */); + return ts.createKeywordTypeNode(140 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152 /* BigIntKeyword */); + return ts.createKeywordTypeNode(151 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129 /* BooleanKeyword */); + return ts.createKeywordTypeNode(128 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38409,7 +38438,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38417,7 +38446,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38425,15 +38454,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138 /* NeverKeyword */); + return ts.createKeywordTypeNode(137 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145 /* SymbolKeyword */); + return ts.createKeywordTypeNode(144 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142 /* ObjectKeyword */); + return ts.createKeywordTypeNode(141 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38482,7 +38511,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38509,11 +38538,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728 /* Awaited */) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); - } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38558,7 +38582,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38588,7 +38612,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; + return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38639,12 +38663,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); return signatureNode; } } @@ -38665,7 +38689,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38679,12 +38703,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38779,11 +38803,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38860,7 +38884,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38877,7 +38901,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38886,8 +38910,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38938,7 +38962,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38951,7 +38975,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38965,7 +38989,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -39009,9 +39033,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -39023,7 +39047,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -39042,7 +39066,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192 /* BindingElement */) { + if (clone.kind === 191 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -39183,7 +39207,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39489,8 +39513,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39829,8 +39853,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39945,7 +39969,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -40038,7 +40062,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -40070,7 +40094,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -40080,13 +40104,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -40095,24 +40119,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -40120,11 +40144,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 210 /* BinaryExpression */: - case 195 /* PropertyAccessExpression */: + case 209 /* BinaryExpression */: + case 194 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40345,17 +40369,17 @@ var ts; return result; function visitExistingNodeTreeSymbols(node) { // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 302 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40624,8 +40648,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); - if (node.kind === 248 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); + if (node.kind === 247 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40633,11 +40657,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 /* ModuleBlock */ && + node.parent.kind === 250 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40696,17 +40720,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40723,28 +40747,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 245 /* FunctionDeclaration */: - case 249 /* EnumDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 248 /* EnumDeclaration */: + case 253 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40752,54 +40776,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 163 /* Constructor */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 157 /* Parameter */: - case 251 /* ModuleBlock */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 170 /* TypeReference */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 183 /* ParenthesizedType */: + case 162 /* Constructor */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 156 /* Parameter */: + case 250 /* ModuleBlock */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 169 /* TypeReference */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 182 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: return false; // Type parameters are always visible - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 291 /* SourceFile */: - case 253 /* NamespaceExportDeclaration */: + case 290 /* SourceFile */: + case 252 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return false; default: return false; @@ -40808,10 +40832,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 264 /* ExportSpecifier */) { + else if (node.parent.kind === 263 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40914,12 +40938,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 244 /* VariableDeclarationList */: - case 259 /* ImportSpecifier */: - case 258 /* NamedImports */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 242 /* VariableDeclaration */: + case 243 /* VariableDeclarationList */: + case 258 /* ImportSpecifier */: + case 257 /* NamedImports */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: return false; default: return true; @@ -40952,7 +40976,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -41006,7 +41030,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -41021,23 +41045,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ancestor.initializer; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { + if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -41063,7 +41087,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 190 /* ObjectBindingPattern */) { + if (pattern.kind === 189 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -41136,7 +41160,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -41146,11 +41170,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -41169,7 +41193,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -41183,11 +41207,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157 /* Parameter */) { + if (declaration.kind === 156 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); + if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41402,9 +41426,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 163 /* Constructor */ || - thisContainer.kind === 245 /* FunctionDeclaration */ || - (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 /* Constructor */ || + thisContainer.kind === 244 /* FunctionDeclaration */ || + (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41488,7 +41512,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41512,7 +41536,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 /* ObjectBindingPattern */ + return pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41551,7 +41575,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41609,7 +41633,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260 /* ExportAssignment */) { + if (declaration.kind === 259 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41680,7 +41704,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41714,15 +41738,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41790,9 +41814,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 /* BinaryExpression */ || + else if (declaration.kind === 209 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210 /* BinaryExpression */) { + declaration.parent.kind === 209 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41859,7 +41883,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41958,36 +41982,36 @@ var ts; return undefined; } switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: - case 316 /* JSDocCallbackTag */: - case 187 /* MappedType */: - case 181 /* ConditionalType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 186 /* MappedType */: + case 180 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187 /* MappedType */) { + if (node.kind === 186 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181 /* ConditionalType */) { + else if (node.kind === 180 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41995,7 +42019,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -42005,9 +42029,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 246 /* ClassDeclaration */ || - node.kind === 215 /* ClassExpression */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || + node.kind === 214 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42225,7 +42249,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42261,7 +42285,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */) { + if (declaration.kind === 246 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42349,7 +42373,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210 /* BinaryExpression */) { + else if (expr.kind === 209 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42364,12 +42388,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42383,7 +42407,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42410,7 +42434,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42483,22 +42507,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: - case 188 /* LiteralType */: + case 137 /* NeverKeyword */: + case 187 /* LiteralType */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isThislessType(node.elementType); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42524,7 +42548,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42540,14 +42564,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -43463,8 +43487,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 185 /* TypeOperator */ && - constraintDeclaration.operator === 135 /* KeyOfKeyword */; + return constraintDeclaration.kind === 184 /* TypeOperator */ && + constraintDeclaration.operator === 134 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43689,7 +43713,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432 /* Instantiable */) { + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43725,7 +43749,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43827,10 +43851,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728 /* Awaited */) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43902,7 +43922,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -44190,10 +44210,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 300 /* JSDocOptionalType */ + node.type && node.type.kind === 299 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44227,7 +44247,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44309,7 +44329,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188 /* LiteralType */) { + if (type && type.kind === 187 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -44322,16 +44342,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && + if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 /* Constructor */ ? + var classType = declaration.kind === 162 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44396,11 +44416,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return node.name.kind === 155 /* ComputedPropertyName */ + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return node.name.kind === 154 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44472,7 +44492,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 /* ThisType */ ? + return parameterName.kind === 183 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44515,7 +44535,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163 /* Constructor */) { + if (declaration.kind === 162 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44525,12 +44545,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44620,7 +44640,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; + var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44634,7 +44654,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44668,13 +44688,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182 /* InferType */) { + if (declaration.parent.kind === 181 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 170 /* TypeReference */) { + if (grandParent.kind === 169 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44699,7 +44719,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44724,7 +44744,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44733,7 +44753,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44813,8 +44833,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44858,7 +44878,7 @@ var ts; return errorType; } } - if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44903,9 +44923,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44972,7 +44992,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44998,7 +45018,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -45007,9 +45027,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -45020,7 +45040,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -45133,9 +45153,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return declaration; } } @@ -45256,19 +45276,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { + if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45277,15 +45297,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183 /* ParenthesizedType */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 186 /* IndexedAccessType */: - case 181 /* ConditionalType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 185 /* IndexedAccessType */: + case 180 /* ConditionalType */: + case 184 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } return false; @@ -45294,27 +45314,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; - case 185 /* TypeOperator */: - return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 300 /* JSDocOptionalType */: - case 298 /* JSDocNullableType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 184 /* TypeOperator */: + return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 299 /* JSDocOptionalType */: + case 297 /* JSDocNullableType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 178 /* RestType */: - return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 177 /* RestType */: + return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 178 /* UnionType */: + case 179 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45328,18 +45348,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45444,7 +45464,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 201064448 /* StructuredOrInstantiable */) + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45576,7 +45596,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45930,7 +45950,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45952,24 +45972,20 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ + case 147 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128 /* AwaitedKeyword */: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -46004,13 +46020,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -46021,7 +46037,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -46158,9 +46174,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -46171,7 +46187,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -46181,7 +46197,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -46234,7 +46250,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 197394432 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46306,7 +46322,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46619,7 +46635,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46866,7 +46882,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46902,88 +46918,88 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return anyType; - case 149 /* UnknownKeyword */: + case 148 /* UnknownKeyword */: return unknownType; - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return stringType; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return numberType; - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return bigintType; - case 129 /* BooleanKeyword */: + case 128 /* BooleanKeyword */: return booleanType; - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return neverType; - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getTypeFromTypeReference(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 183 /* ParenthesizedType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 182 /* ParenthesizedType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 178 /* RestType */: + case 177 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 182 /* InferType */: + case 181 /* InferType */: return getTypeFromInferTypeNode(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47191,9 +47207,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 /* QualifiedName */ || - node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 /* QualifiedName */ || + node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -47202,7 +47218,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47211,12 +47227,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -47248,7 +47264,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -47366,7 +47382,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { return getMappedType(type, mapper); @@ -47414,9 +47429,6 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728 /* Awaited */) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432 /* Substitution */) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { @@ -47458,35 +47470,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274 /* JsxAttribute */: { + case 273 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277 /* JsxExpression */: { + case 276 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47505,7 +47517,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47518,7 +47530,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47571,7 +47583,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47621,23 +47633,23 @@ var ts; return true; } switch (node.kind) { - case 277 /* JsxExpression */: - case 201 /* ParenthesizedExpression */: + case 276 /* JsxExpression */: + case 200 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47828,7 +47840,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47837,9 +47849,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47990,11 +48002,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165 /* SetAccessor */: return [3 /*break*/, 2]; - case 164 /* GetAccessor */: return [3 /*break*/, 2]; - case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 164 /* SetAccessor */: return [3 /*break*/, 2]; + case 163 /* GetAccessor */: return [3 /*break*/, 2]; + case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -48071,8 +48083,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && - kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && + kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48333,7 +48345,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48743,7 +48755,7 @@ var ts; result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } } - if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -49108,8 +49120,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -49236,17 +49247,6 @@ var ts; } } } - else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - // An `awaited S` is related to an `awaited T` if `S` is related to `T`: - // - // S <: T ⇒ awaited S <: awaited T - // - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49364,21 +49364,6 @@ var ts; } } } - else if (source.flags & 134217728 /* Awaited */) { - // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the - // constraint of `S`: - // - // S <: C ^ awaited C <: T ⇒ awaited S <: T - // - // For example `awaited Promise` is assignable to `number`. - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -50230,11 +50215,13 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } } variances.push(variance); }; @@ -51007,12 +50994,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210 /* BinaryExpression */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 209 /* BinaryExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157 /* Parameter */: + case 156 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -51027,23 +51014,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -51057,7 +51044,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187 /* MappedType */: + case 186 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -51185,7 +51172,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 197394432 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51481,7 +51468,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 197394432 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51516,9 +51503,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51526,10 +51510,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728 /* Awaited */) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51543,7 +51523,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51655,34 +51635,10 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576 /* Union */) { var nakedTypeVariable = void 0; - for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { - var t = targets_2[_i]; - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - } - // To better support backwards compatibility with the new `awaited` type, we detect a target - // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, - // we infer from source to the type parameter `T`, where each type of source is mapped to extract - // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } var sources = source.flags & 1048576 /* Union */ ? source.types : [source]; var matched_1 = new Array(sources.length); var inferenceCircularity = false; @@ -51690,9 +51646,13 @@ var ts; // track whether inferences were made from that particular type to some target with // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t = targets_2[_i]; + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512 /* MaxValue */; @@ -51730,8 +51690,8 @@ var ts; // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -51745,8 +51705,8 @@ var ts; // we want to infer string for T, not Promise | string. For intersection types // we only infer to single naked type variables. if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1 /* NakedTypeVariable */); } @@ -51903,7 +51863,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; + bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -52073,7 +52033,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -52094,7 +52054,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -52109,11 +52069,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -52124,24 +52084,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201 /* ParenthesizedExpression */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && + (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -52151,11 +52111,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -52184,7 +52144,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -52217,7 +52177,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -52335,7 +52295,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 197394432 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52372,15 +52332,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52397,21 +52357,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return stringType; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return undefinedType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52419,7 +52379,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 /* ObjectBindingPattern */ ? + var type = pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52437,30 +52397,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232 /* ForInStatement */) { + if (node.parent.parent.kind === 231 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.parent.kind === 232 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 /* VariableDeclaration */ ? + return node.kind === 242 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 /* VariableDeclaration */ && node.initializer && + return node.kind === 242 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && + node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52472,13 +52432,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 /* ParenthesizedExpression */ || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 200 /* ParenthesizedExpression */ || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52498,7 +52458,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52660,12 +52620,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 /* CallExpression */ + parent.parent.kind === 196 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 210 /* BinaryExpression */ && + parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52673,8 +52633,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || - declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && + return (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || + declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52687,7 +52647,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, /*diagnostic*/ undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -52713,11 +52673,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52731,7 +52691,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52775,7 +52735,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52850,7 +52810,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52862,7 +52822,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52943,8 +52903,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 195 /* PropertyAccessExpression */ && - reference.kind !== 196 /* ElementAccessExpression */ && + reference.kind !== 194 /* PropertyAccessExpression */ && + reference.kind !== 195 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52969,7 +52929,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -53009,14 +52969,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { + if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -53027,7 +52987,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -53058,7 +53018,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 /* CallExpression */ ? + var expr = node.kind === 196 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -53066,7 +53026,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -53116,7 +53076,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -53124,7 +53084,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -53336,10 +53296,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -53463,7 +53423,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 210 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 209 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53487,7 +53447,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53557,7 +53517,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53771,16 +53731,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53825,9 +53785,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 /* ModuleBlock */ || - node.kind === 291 /* SourceFile */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 250 /* ModuleBlock */ || + node.kind === 290 /* SourceFile */ || + node.kind === 159 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53849,7 +53809,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { symbol.isAssigned = true; } } @@ -53865,7 +53825,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 /* Parameter */ && + declaration.kind === 156 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53879,13 +53839,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 /* PropertyAccessExpression */ || - parent.kind === 197 /* CallExpression */ && parent.expression === node || - parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 194 /* PropertyAccessExpression */ || + parent.kind === 196 /* CallExpression */ && parent.expression === node || + parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53924,7 +53884,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { 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 /* Async */)) { @@ -53945,7 +53905,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 246 /* ClassDeclaration */ + if (declaration.kind === 245 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53957,14 +53917,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215 /* ClassExpression */) { + else if (declaration.kind === 214 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 291 /* SourceFile */) { + while (container.kind !== 290 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -54013,7 +53973,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -54022,8 +53982,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || - flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || + flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -54032,9 +53992,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || - node.parent.kind === 219 /* NonNullExpression */ || - declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || + node.parent.kind === 218 /* NonNullExpression */ || + declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -54069,7 +54029,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -54092,7 +54052,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -54113,7 +54073,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -54132,7 +54092,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 201 /* ParenthesizedExpression */) { + while (current.parent.kind === 200 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -54140,7 +54100,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -54153,7 +54113,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { + if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -54221,37 +54181,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 163 /* Constructor */) { + if (container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 163 /* Constructor */: + case 162 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -54301,7 +54261,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && + (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -54348,7 +54308,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 202 /* FunctionExpression */ && + if (container.kind === 201 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -54358,16 +54318,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 162 /* MethodDeclaration */ && - container.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 161 /* MethodDeclaration */ && + container.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 202 /* FunctionExpression */ && - container.parent.kind === 282 /* PropertyAssignment */ && - container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && + container.parent.kind === 281 /* PropertyAssignment */ && + container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -54375,7 +54335,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 202 /* FunctionExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -54400,7 +54360,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -54414,15 +54374,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 203 /* ArrowFunction */) { + while (container && container.kind === 202 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54435,14 +54395,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); - if (current && current.kind === 155 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); + if (current && current.kind === 154 /* ComputedPropertyName */) { 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 === 194 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54450,7 +54410,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163 /* Constructor */) { + if (!isCallExpression && container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54519,7 +54479,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54533,7 +54493,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (container.parent.kind === 193 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54554,7 +54514,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54569,7 +54529,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 163 /* Constructor */; + return container.kind === 162 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54577,21 +54537,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */; } else { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */ || - container.kind === 160 /* PropertyDeclaration */ || - container.kind === 159 /* PropertySignature */ || - container.kind === 163 /* Constructor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */ || + container.kind === 159 /* PropertyDeclaration */ || + container.kind === 158 /* PropertySignature */ || + container.kind === 162 /* Constructor */; } } } @@ -54599,10 +54559,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 /* MethodDeclaration */ || - func.kind === 164 /* GetAccessor */ || - func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 161 /* MethodDeclaration */ || + func.kind === 163 /* GetAccessor */ || + func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54614,7 +54574,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54641,7 +54601,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282 /* PropertyAssignment */) { + if (literal.parent.kind !== 281 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54655,7 +54615,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54708,9 +54668,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157 /* Parameter */: + case 156 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54719,7 +54679,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54760,9 +54720,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54774,9 +54731,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54847,7 +54801,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199 /* TaggedTemplateExpression */) { + if (template.parent.kind === 198 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -55083,21 +55037,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return true; - case 195 /* PropertyAccessExpression */: - case 201 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 200 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -55122,7 +55076,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -55145,7 +55099,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -55183,58 +55137,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 191 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 203 /* ArrowFunction */: - case 236 /* ReturnStatement */: + case 202 /* ArrowFunction */: + case 235 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 198 /* NewExpression */: + case 197 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193 /* ArrayLiteralExpression */: { + case 192 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); + case 221 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -55391,7 +55345,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; + return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -55405,7 +55359,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55450,8 +55404,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 /* BindingElement */ && !!node.initializer) || - (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 191 /* BindingElement */ && !!node.initializer) || + (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55464,7 +55418,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 /* SpreadElement */ && e.expression; + var spread = e.kind === 213 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55550,7 +55504,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55641,7 +55595,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55655,13 +55609,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 /* PropertyAssignment */ || - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 281 /* PropertyAssignment */ || + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55684,8 +55638,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55711,7 +55665,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284 /* SpreadAssignment */) { + else if (memberDecl.kind === 283 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55740,7 +55694,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55765,7 +55719,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55807,13 +55761,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55909,7 +55863,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55935,7 +55889,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -56365,7 +56319,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56524,7 +56478,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201 /* ParenthesizedExpression */) { + while (node.parent.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56677,7 +56631,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56709,8 +56663,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && - node.parent.kind !== 170 /* TypeReference */ && + else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && + node.parent.kind !== 169 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56722,22 +56676,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return true; - case 282 /* PropertyAssignment */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 284 /* SpreadAssignment */: - case 155 /* ComputedPropertyName */: - case 222 /* TemplateSpan */: - case 277 /* JsxExpression */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 269 /* JsxOpeningElement */: - case 217 /* ExpressionWithTypeArguments */: - case 280 /* HeritageClause */: + case 281 /* PropertyAssignment */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 283 /* SpreadAssignment */: + case 154 /* ComputedPropertyName */: + case 221 /* TemplateSpan */: + case 276 /* JsxExpression */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 268 /* JsxOpeningElement */: + case 216 /* ExpressionWithTypeArguments */: + case 279 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56926,16 +56880,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 189 /* ImportType */: + case 188 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56958,7 +56912,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer.kind === 243 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56987,7 +56941,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 /* ForInStatement */ && + if (node.kind === 231 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -57071,13 +57025,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158 /* Decorator */) { + else if (node.kind !== 157 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -57141,7 +57095,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -57155,9 +57109,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 212 /* TemplateExpression */) { + if (node.template.kind === 211 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -57172,7 +57126,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158 /* Decorator */) { + else if (node.kind === 157 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -57187,7 +57141,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 198 /* NewExpression */); + ts.Debug.assert(node.kind === 197 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -57280,7 +57234,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 158 /* Decorator */) { + if (node.kind !== 157 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -57323,7 +57277,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -57337,7 +57291,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -57347,7 +57301,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 221 /* SyntheticExpression */ ? + return arg.kind === 220 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57502,7 +57456,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57532,7 +57486,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57573,7 +57527,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57581,7 +57535,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57591,17 +57545,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158 /* Decorator */) { + if (node.kind === 157 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57631,30 +57585,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157 /* Parameter */: + case 156 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57668,17 +57622,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 1; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return 2; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 157 /* Parameter */: + case 156 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57803,8 +57757,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 158 /* Decorator */; + var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 157 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57866,7 +57820,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -58382,7 +58336,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 163 /* Constructor */) { + if (!modifiers || declaration.kind !== 162 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58513,16 +58467,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58613,16 +58567,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158 /* Decorator */: + case 157 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58711,7 +58665,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195 /* PropertyAccessExpression */) { + while (parent && parent.kind === 194 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58736,12 +58690,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 198 /* NewExpression */) { + if (node.kind === 197 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 /* Constructor */ && - declaration.kind !== 167 /* ConstructSignature */ && - declaration.kind !== 172 /* ConstructorType */ && + declaration.kind !== 162 /* Constructor */ && + declaration.kind !== 166 /* ConstructSignature */ && + declaration.kind !== 171 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58761,7 +58715,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && + if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58868,9 +58822,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 245 /* FunctionDeclaration */ + ? 244 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 243 /* VariableDeclaration */ + ? 242 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58898,18 +58852,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return true; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58940,8 +58894,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -58959,7 +58919,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163 /* Constructor */) { + else if (container.kind === 162 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -59185,7 +59145,7 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -59195,7 +59155,7 @@ var ts; var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -59226,7 +59186,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -59413,7 +59373,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205 /* TypeOfExpression */) { + if (node.expression.kind === 204 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -59472,11 +59432,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 162 /* MethodDeclaration */: - return func.parent.kind === 194 /* ObjectLiteralExpression */; + case 161 /* MethodDeclaration */: + return func.parent.kind === 193 /* ObjectLiteralExpression */; default: return false; } @@ -59502,7 +59462,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59535,7 +59495,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59559,7 +59519,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59612,7 +59572,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59625,7 +59585,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224 /* Block */) { + if (node.body.kind === 223 /* Block */) { checkSourceElement(node.body); } else { @@ -59715,7 +59675,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163 /* Constructor */)) { + if (!(ctor && ctor.kind === 162 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59740,7 +59700,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257 /* NamespaceImport */; + return !!declaration && declaration.kind === 256 /* NamespaceImport */; } } } @@ -59748,7 +59708,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { // References are combinations of identifiers, parentheses, and property accesses. - var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); + var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 75 /* Identifier */ && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -59766,7 +59726,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59816,7 +59776,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59988,7 +59948,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -60008,7 +59968,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -60021,9 +59981,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 284 /* SpreadAssignment */) { + else if (property.kind === 283 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -60066,8 +60026,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216 /* OmittedExpression */) { - if (element.kind !== 214 /* SpreadElement */) { + if (element.kind !== 215 /* OmittedExpression */) { + if (element.kind !== 213 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -60085,7 +60045,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -60101,7 +60061,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -60117,24 +60077,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194 /* ObjectLiteralExpression */) { + if (target.kind === 193 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193 /* ArrayLiteralExpression */) { + if (target.kind === 192 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 /* SpreadAssignment */ ? + var error = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -60159,36 +60119,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 199 /* TaggedTemplateExpression */: - case 212 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 147 /* UndefinedKeyword */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 205 /* TypeOfExpression */: - case 219 /* NonNullExpression */: - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: + case 146 /* UndefinedKeyword */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 204 /* TypeOfExpression */: + case 218 /* NonNullExpression */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: return true; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -60200,9 +60160,9 @@ var ts; } return false; // Some forms listed here for clarity - case 206 /* VoidExpression */: // Explicit opt-out - case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 205 /* VoidExpression */: // Explicit opt-out + case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -60234,7 +60194,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -60301,7 +60261,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60706,7 +60666,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60755,13 +60715,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; + return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60771,7 +60731,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60800,7 +60760,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60837,7 +60797,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60848,7 +60808,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -61082,11 +61042,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums 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_or_type_query); } @@ -61111,9 +61071,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -61139,78 +61099,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return checkQualifiedName(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checkCallExpression(node, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return checkClassExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return checkAssertion(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return checkNonNullAssertion(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return checkMetaProperty(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkDeleteExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return checkVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return checkAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return undefinedWideningType; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return checkYieldExpression(node); - case 221 /* SyntheticExpression */: + case 220 /* SyntheticExpression */: return node.type; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return checkJsxElement(node, checkMode); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return checkJsxFragment(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -61247,10 +61207,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -61261,13 +61221,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { + if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + if (func.kind === 163 /* GetAccessor */ || func.kind === 164 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -61325,13 +61285,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203 /* ArrowFunction */: - case 166 /* CallSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 171 /* FunctionType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 202 /* ArrowFunction */: + case 165 /* CallSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 170 /* FunctionType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -61349,7 +61309,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { + else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -61358,13 +61318,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || - node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || - node.kind === 167 /* ConstructSignature */) { + else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || + node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || + node.kind === 166 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -61394,10 +61354,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -61427,7 +61387,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { + if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -61439,7 +61399,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163 /* Constructor */) { + if (member.kind === 162 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -61459,16 +61419,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61531,7 +61491,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159 /* PropertySignature */) { + if (member.kind === 158 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61556,7 +61516,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61576,7 +61536,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61584,7 +61544,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61626,7 +61586,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61654,7 +61614,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 /* PropertyDeclaration */ && + return n.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61684,7 +61644,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61709,7 +61669,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61719,7 +61679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61728,7 +61688,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61746,7 +61706,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61794,7 +61754,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61839,7 +61799,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178 /* RestType */) { + if (e.kind === 177 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61848,7 +61808,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177 /* OptionalType */) { + else if (e.kind === 176 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61869,7 +61829,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61920,7 +61880,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61937,9 +61897,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 247 /* InterfaceDeclaration */ && - n.parent.kind !== 246 /* ClassDeclaration */ && - n.parent.kind !== 215 /* ClassExpression */ && + if (n.parent.kind !== 246 /* InterfaceDeclaration */ && + n.parent.kind !== 245 /* ClassDeclaration */ && + n.parent.kind !== 214 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -62035,7 +61995,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && + var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -62075,7 +62035,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -62086,10 +62046,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { + if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -62220,25 +62180,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return 2 /* ExportType */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -62246,17 +62206,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 245 /* FunctionDeclaration */: - case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 244 /* FunctionDeclaration */: + case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -62296,9 +62256,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { @@ -62335,28 +62294,6 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - /** - * Gets or creates an `awaited T` type for a generic type. - * - * The "awaited type" of a generic type cannot be determined until it is instantiated. As - * a result, an `AwaitedType` for the generic type is created that can be instantiated - * or related later. - */ - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728 /* Awaited */); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; - } /** * Determines whether a type has a callable `then` member. */ @@ -62364,32 +62301,6 @@ var ts; var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; } - /** - * Determines whether a type is a generic type whose base constraint could possibly resolve to a different - * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: - * - The type is a generic object type, - * - AND one of the following conditions are met - * - The type has no base constraint, - * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, - * - OR The base constraint has a callable `then` member. - * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a - * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound - * behavior is much more developer friendly. - */ - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152 /* Intersection */) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } /** * Gets the "awaited type" of a type. * @@ -62398,60 +62309,22 @@ var ts; * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a * non-promise type is found. * - * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` - * type. + * This is used to reflect the runtime behavior of the `await` keyword. */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } // For a union, get a union of the awaited types of each constituent. // - // For example: - // - // awaited (number | string) -> number | string - // awaited (number | Promise) -> number | string - // awaited (T | string) -> awaited T | string - // awaited (T | Promise) -> awaited T | string - // awaited (T | Promise) -> awaited T - // awaited (T | U) -> awaited T | awaited U - // return typeAsAwaitable.awaitedTypeOfType = mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } - // We cannot resolve the awaited type for a type variable until it is instantiated. As - // such, we create an `awaited T` type that can either be instantiated or related later. - // - // For example: - // - // T -> awaited T - // - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -62635,24 +62508,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157 /* Parameter */: + case 156 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62699,14 +62572,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; } } @@ -62715,13 +62588,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62767,14 +62640,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62783,23 +62656,23 @@ var ts; } } break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157 /* Parameter */: + case 156 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62862,7 +62735,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62903,7 +62776,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62916,7 +62789,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62945,7 +62818,7 @@ var ts; } } } - var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62987,42 +62860,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291 /* SourceFile */: - case 250 /* ModuleDeclaration */: - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 290 /* SourceFile */: + case 249 /* ModuleDeclaration */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182 /* InferType */: + case 181 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -63042,11 +62915,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162 /* MethodDeclaration */: - case 160 /* PropertyDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 161 /* MethodDeclaration */: + case 159 /* PropertyDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -63057,7 +62930,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -63065,8 +62938,8 @@ var ts; } } break; - case 168 /* IndexSignature */: - case 223 /* SemicolonClassElement */: + case 167 /* IndexSignature */: + case 222 /* SemicolonClassElement */: // Can't be private break; default: @@ -63093,7 +62966,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -63176,7 +63049,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -63194,7 +63067,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -63215,7 +63088,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -63229,22 +63102,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; + return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 224 /* Block */) { + if (node.kind === 223 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -63274,12 +63147,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 /* PropertyDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 162 /* MethodDeclaration */ || - node.kind === 161 /* MethodSignature */ || - node.kind === 164 /* GetAccessor */ || - node.kind === 165 /* SetAccessor */) { + if (node.kind === 159 /* PropertyDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 161 /* MethodDeclaration */ || + node.kind === 160 /* MethodSignature */ || + node.kind === 163 /* GetAccessor */ || + node.kind === 164 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -63288,7 +63161,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -63345,7 +63218,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63360,7 +63233,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63395,7 +63268,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -63407,17 +63280,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 251 /* ModuleBlock */ || - container.kind === 250 /* ModuleDeclaration */ || - container.kind === 291 /* SourceFile */); + (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 250 /* ModuleBlock */ || + container.kind === 249 /* ModuleDeclaration */ || + container.kind === 290 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -63447,18 +63320,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192 /* BindingElement */) { - if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 191 /* BindingElement */) { + if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -63479,19 +63352,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -63528,7 +63401,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -63554,10 +63427,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { + if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -63569,7 +63442,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ + var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63579,8 +63452,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || - (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { + if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || + (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63620,7 +63493,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225 /* EmptyStatement */) { + if (node.thenStatement.kind === 224 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63691,12 +63564,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63730,14 +63603,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63769,7 +63642,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { 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); @@ -63783,7 +63656,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63796,7 +63669,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -64436,7 +64309,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -64458,12 +64331,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165 /* SetAccessor */) { + if (func.kind === 164 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163 /* Constructor */) { + else if (func.kind === 162 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -64471,7 +64344,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -64481,7 +64354,7 @@ var ts; } } } - else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -64510,7 +64383,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -64519,7 +64392,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -64551,7 +64424,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64658,8 +64531,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 /* BinaryExpression */ || - name.kind === 155 /* ComputedPropertyName */ || + (propDeclaration.kind === 209 /* BinaryExpression */ || + name.kind === 154 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64736,7 +64609,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170 /* TypeReference */) { + if (node.kind === 169 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64982,7 +64855,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; + return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -65037,7 +64910,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215 /* ClassExpression */) { + if (derivedClassDecl.kind === 214 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -65059,7 +64932,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -65074,7 +64947,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -65171,7 +65044,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 /* PropertyDeclaration */ && + return node.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -65195,7 +65068,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -65301,7 +65174,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -65311,7 +65184,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -65340,7 +65213,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -65348,14 +65221,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 195 /* PropertyAccessExpression */) { + if (ex.kind === 194 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -65385,8 +65258,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -65422,7 +65295,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 249 /* EnumDeclaration */) { + if (declaration.kind !== 248 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -65450,8 +65323,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 /* ClassDeclaration */ || - (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 /* ClassDeclaration */ || + (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -65514,7 +65387,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -65564,23 +65437,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192 /* BindingElement */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 242 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65591,12 +65464,12 @@ var ts; break; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 245 /* FunctionDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65619,12 +65492,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65644,9 +65517,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65681,14 +65554,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 /* ExportSpecifier */ ? + var message = node.kind === 263 /* ExportSpecifier */ ? 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)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 264 /* ExportSpecifier */ + && node.kind === 263 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65716,7 +65589,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65740,7 +65613,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65785,10 +65658,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65806,14 +65679,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65869,8 +65742,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65984,165 +65857,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return checkTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return checkParameter(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return checkPropertySignature(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return checkSignatureDeclaration(node); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return checkMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return checkConstructorDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return checkAccessorDeclaration(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return checkTypeReferenceNode(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return checkTypePredicate(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return checkTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return checkTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return checkArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return checkTupleType(node); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 178 /* RestType */: + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 177 /* RestType */: return checkSourceElement(node.type); - case 184 /* ThisType */: + case 183 /* ThisType */: return checkThisType(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return checkTypeOperator(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return checkConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return checkInferType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return checkImportType(node); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: - case 305 /* JSDocTypeLiteral */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: + case 304 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 295 /* JSDocTypeExpression */: + case 294 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return checkMappedType(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return checkBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return checkVariableStatement(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return checkExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return checkIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return checkDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return checkWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return checkForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return checkForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkForOfStatement(node); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return checkReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return checkSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return checkThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return checkTryStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return checkBindingElement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return checkClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return checkImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return checkExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return checkExportAssignment(node); - case 225 /* EmptyStatement */: - case 242 /* DebuggerStatement */: + case 224 /* EmptyStatement */: + case 241 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -66237,33 +66110,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: - case 269 /* JsxOpeningElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: + case 268 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 267 /* JsxElement */: + case 266 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -66406,17 +66279,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -66424,8 +66297,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -66434,7 +66307,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -66482,16 +66355,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156 /* TypeParameter */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 155 /* TypeParameter */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return true; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -66499,16 +66372,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 170 /* TypeReference */; + return node.parent.kind === 169 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195 /* PropertyAccessExpression */) { + while (node.parent.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 217 /* ExpressionWithTypeArguments */; + return node.parent.kind === 216 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -66536,13 +66409,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -66568,7 +66441,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66578,7 +66451,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 /* PropertyAccessExpression */ && + name.parent.kind === 194 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66588,7 +66461,7 @@ var ts; } } } - if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66598,7 +66471,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66616,7 +66489,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66632,10 +66505,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318 /* JSDocParameterTag */) { + if (name.parent.kind === 317 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { + if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66652,12 +66525,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { + else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195 /* PropertyAccessExpression */) { + if (name.kind === 194 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66667,17 +66540,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 169 /* TypePredicate */) { + if (name.parent.kind === 168 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66700,8 +66573,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 /* BindingElement */ && - grandParent.kind === 190 /* ObjectBindingPattern */ && + else if (parent.kind === 191 /* BindingElement */ && + grandParent.kind === 189 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66713,8 +66586,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66728,14 +66601,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 184 /* ThisType */: + case 183 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66746,7 +66619,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66768,7 +66641,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66777,7 +66650,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66848,23 +66721,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 233 /* ForOfStatement */) { + if (expr.parent.kind === 232 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 210 /* BinaryExpression */) { + if (expr.parent.kind === 209 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 282 /* PropertyAssignment */) { + if (expr.parent.kind === 281 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66912,7 +66785,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66968,7 +66841,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -67024,7 +66897,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -67052,7 +66925,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -67083,7 +66956,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -67124,19 +66997,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -67145,7 +67018,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -67247,15 +67120,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285 /* EnumMember */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 284 /* EnumMember */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285 /* EnumMember */) { + if (node.kind === 284 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -67496,12 +67369,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; + var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -67517,7 +67390,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -67526,7 +67399,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; + return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -67538,7 +67411,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67589,7 +67462,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67617,12 +67490,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67814,14 +67687,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 /* MethodDeclaration */ && !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 === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { + else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { 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); @@ -67838,17 +67711,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139 /* ReadonlyKeyword */) { - if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { + if (modifier.kind !== 138 /* ReadonlyKeyword */) { + if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 249 /* EnumDeclaration */) { + if (node.kind !== 248 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67868,7 +67741,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67894,10 +67767,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67909,11 +67782,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { + else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67936,19 +67809,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67958,10 +67831,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67974,14 +67847,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246 /* ClassDeclaration */) { - if (node.kind !== 162 /* MethodDeclaration */ && - node.kind !== 160 /* PropertyDeclaration */ && - node.kind !== 164 /* GetAccessor */ && - node.kind !== 165 /* SetAccessor */) { + if (node.kind !== 245 /* ClassDeclaration */) { + if (node.kind !== 161 /* MethodDeclaration */ && + node.kind !== 159 /* PropertyDeclaration */ && + node.kind !== 163 /* GetAccessor */ && + node.kind !== 164 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -68003,7 +67876,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -68011,7 +67884,7 @@ var ts; break; } } - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -68026,13 +67899,13 @@ var ts; } return false; } - else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -68053,37 +67926,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 250 /* ModuleDeclaration */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 157 /* Parameter */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 249 /* ModuleDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 156 /* Parameter */: return false; default: - if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return false; } switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 247 /* InterfaceDeclaration */: - case 226 /* VariableStatement */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 225 /* VariableStatement */: + case 247 /* TypeAliasDeclaration */: return true; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -68096,10 +67969,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -68214,7 +68087,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 !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { + if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -68256,7 +68129,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216 /* OmittedExpression */) { + if (arg.kind === 215 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -68333,20 +68206,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 162 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 161 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -68365,7 +68238,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */) { + if (prop.kind === 283 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -68376,11 +68249,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -68393,7 +68266,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -68408,10 +68281,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -68419,13 +68292,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -68464,7 +68337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276 /* JsxSpreadAttribute */) { + if (attr.kind === 275 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -68474,7 +68347,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -68488,14 +68361,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163 /* Constructor */) { + if (func && func.kind !== 162 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -68506,7 +68379,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -68521,20 +68394,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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); @@ -68559,11 +68432,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165 /* SetAccessor */) { + if (accessor.kind === 164 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68585,21 +68458,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148 /* UniqueKeyword */) { - if (node.type.kind !== 145 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); + if (node.operator === 147 /* UniqueKeyword */) { + if (node.type.kind !== 144 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68611,13 +68484,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68626,9 +68499,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139 /* ReadonlyKeyword */) { - if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); + else if (node.operator === 138 /* ReadonlyKeyword */) { + if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); } } } @@ -68641,8 +68514,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162 /* MethodDeclaration */) { - if (node.parent.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 161 /* MethodDeclaration */) { + if (node.parent.kind === 193 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68670,14 +68543,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68688,11 +68561,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68700,8 +68573,8 @@ var ts; return false; } break; - case 238 /* SwitchStatement */: - if (node.kind === 235 /* BreakStatement */ && !node.label) { + case 237 /* SwitchStatement */: + if (node.kind === 234 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68716,13 +68589,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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 === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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); @@ -68746,12 +68619,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68782,7 +68655,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { + if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68795,7 +68668,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68858,15 +68731,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return false; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68950,7 +68823,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68958,7 +68831,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68987,13 +68860,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 248 /* TypeAliasDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 261 /* ExportDeclaration */ || - node.kind === 260 /* ExportAssignment */ || - node.kind === 253 /* NamespaceExportDeclaration */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 247 /* TypeAliasDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 260 /* ExportDeclaration */ || + node.kind === 259 /* ExportAssignment */ || + node.kind === 252 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -69002,7 +68875,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 === 226 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -69025,7 +68898,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -69047,10 +68920,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -69225,14 +69098,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || + return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -69240,14 +69113,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 256 /* ImportClause */: // For default import - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: // For rename import `x as y` + case 255 /* ImportClause */: // For default import + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 259 /* ImportSpecifier */; + return decl.parent.kind === 258 /* ImportSpecifier */; default: return false; } @@ -69510,7 +69383,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(131 /* DeclareKeyword */)); + result.push(createModifier(130 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -69534,7 +69407,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(139 /* ReadonlyKeyword */)); + result.push(createModifier(138 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -69544,7 +69417,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(154 /* QualifiedName */); + var node = createSynthesizedNode(153 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -69563,7 +69436,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155 /* ComputedPropertyName */); + var node = createSynthesizedNode(154 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69576,7 +69449,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156 /* TypeParameter */); + var node = createSynthesizedNode(155 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69592,7 +69465,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157 /* Parameter */); + var node = createSynthesizedNode(156 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69616,7 +69489,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158 /* Decorator */); + var node = createSynthesizedNode(157 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69629,7 +69502,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertySignature */); + var node = createSynthesizedNode(158 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69649,7 +69522,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160 /* PropertyDeclaration */); + var node = createSynthesizedNode(159 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69673,7 +69546,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69690,7 +69563,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162 /* MethodDeclaration */); + var node = createSynthesizedNode(161 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69750,7 +69623,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163 /* Constructor */); + var node = createSynthesizedNode(162 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69770,7 +69643,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164 /* GetAccessor */); + var node = createSynthesizedNode(163 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69793,7 +69666,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165 /* SetAccessor */); + var node = createSynthesizedNode(164 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69814,7 +69687,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69822,7 +69695,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69830,7 +69703,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168 /* IndexSignature */); + var node = createSynthesizedNode(167 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69874,7 +69747,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169 /* TypePredicate */); + var node = createSynthesizedNode(168 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69894,7 +69767,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170 /* TypeReference */); + var node = createSynthesizedNode(169 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69908,7 +69781,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69916,7 +69789,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69924,7 +69797,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173 /* TypeQuery */); + var node = createSynthesizedNode(172 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69936,7 +69809,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174 /* TypeLiteral */); + var node = createSynthesizedNode(173 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69948,7 +69821,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175 /* ArrayType */); + var node = createSynthesizedNode(174 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69960,7 +69833,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176 /* TupleType */); + var node = createSynthesizedNode(175 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69972,7 +69845,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177 /* OptionalType */); + var node = createSynthesizedNode(176 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69984,7 +69857,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178 /* RestType */); + var node = createSynthesizedNode(177 /* RestType */); node.type = type; return node; } @@ -69996,7 +69869,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -70004,7 +69877,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -70023,7 +69896,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181 /* ConditionalType */); + var node = createSynthesizedNode(180 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -70041,7 +69914,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182 /* InferType */); + var node = createSynthesizedNode(181 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -70053,7 +69926,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189 /* ImportType */); + var node = createSynthesizedNode(188 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -70071,7 +69944,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183 /* ParenthesizedType */); + var node = createSynthesizedNode(182 /* ParenthesizedType */); node.type = type; return node; } @@ -70083,12 +69956,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184 /* ThisType */); + return createSynthesizedNode(183 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; + var node = createSynthesizedNode(184 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -70098,7 +69971,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186 /* IndexedAccessType */); + var node = createSynthesizedNode(185 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -70112,7 +69985,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187 /* MappedType */); + var node = createSynthesizedNode(186 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -70130,7 +70003,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188 /* LiteralType */); + var node = createSynthesizedNode(187 /* LiteralType */); node.literal = literal; return node; } @@ -70143,7 +70016,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ObjectBindingPattern */); + var node = createSynthesizedNode(189 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70155,7 +70028,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191 /* ArrayBindingPattern */); + var node = createSynthesizedNode(190 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70167,7 +70040,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192 /* BindingElement */); + var node = createSynthesizedNode(191 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -70186,7 +70059,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -70200,7 +70073,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -70214,7 +70087,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -70222,10 +70095,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - // Not sure why this cast was necessary: the previous line should already establish that node.name is an identifier - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } // Because we are updating existed propertyAccess we want to inherit its emitFlags // instead of using the default from createPropertyAccess @@ -70236,7 +70107,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70257,7 +70128,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -70274,7 +70145,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70292,7 +70163,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -70311,7 +70182,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70331,7 +70202,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198 /* NewExpression */); + var node = createSynthesizedNode(197 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -70347,7 +70218,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -70370,7 +70241,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200 /* TypeAssertionExpression */); + var node = createSynthesizedNode(199 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -70384,7 +70255,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201 /* ParenthesizedExpression */); + var node = createSynthesizedNode(200 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -70396,7 +70267,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202 /* FunctionExpression */); + var node = createSynthesizedNode(201 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -70420,7 +70291,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203 /* ArrowFunction */); + var node = createSynthesizedNode(202 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -70442,7 +70313,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204 /* DeleteExpression */); + var node = createSynthesizedNode(203 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70454,7 +70325,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205 /* TypeOfExpression */); + var node = createSynthesizedNode(204 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70466,7 +70337,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206 /* VoidExpression */); + var node = createSynthesizedNode(205 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70478,7 +70349,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207 /* AwaitExpression */); + var node = createSynthesizedNode(206 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70490,7 +70361,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -70503,7 +70374,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -70516,7 +70387,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210 /* BinaryExpression */); + var node = createSynthesizedNode(209 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -70533,7 +70404,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211 /* ConditionalExpression */); + var node = createSynthesizedNode(210 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -70553,7 +70424,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212 /* TemplateExpression */); + var node = createSynthesizedNode(211 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70650,7 +70521,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213 /* YieldExpression */); + var node = createSynthesizedNode(212 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70664,7 +70535,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214 /* SpreadElement */); + var node = createSynthesizedNode(213 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70676,7 +70547,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215 /* ClassExpression */); + var node = createSynthesizedNode(214 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70697,11 +70568,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216 /* OmittedExpression */); + return createSynthesizedNode(215 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70715,7 +70586,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218 /* AsExpression */); + var node = createSynthesizedNode(217 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70729,19 +70600,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219 /* NonNullExpression */); + var node = createSynthesizedNode(218 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218 /* NonNullExpression */); + node.flags |= 32 /* OptionalChain */; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220 /* MetaProperty */); + var node = createSynthesizedNode(219 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70755,7 +70643,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222 /* TemplateSpan */); + var node = createSynthesizedNode(221 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70769,12 +70657,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223 /* SemicolonClassElement */); + return createSynthesizedNode(222 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224 /* Block */); + var block = createSynthesizedNode(223 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70788,7 +70676,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226 /* VariableStatement */); + var node = createSynthesizedNode(225 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70803,11 +70691,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225 /* EmptyStatement */); + return createSynthesizedNode(224 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227 /* ExpressionStatement */); + var node = createSynthesizedNode(226 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70823,7 +70711,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228 /* IfStatement */); + var node = createSynthesizedNode(227 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70839,7 +70727,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229 /* DoStatement */); + var node = createSynthesizedNode(228 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70853,7 +70741,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230 /* WhileStatement */); + var node = createSynthesizedNode(229 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70867,7 +70755,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231 /* ForStatement */); + var node = createSynthesizedNode(230 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70885,7 +70773,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForInStatement */); + var node = createSynthesizedNode(231 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70901,7 +70789,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233 /* ForOfStatement */); + var node = createSynthesizedNode(232 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70919,7 +70807,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234 /* ContinueStatement */); + var node = createSynthesizedNode(233 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70931,7 +70819,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235 /* BreakStatement */); + var node = createSynthesizedNode(234 /* BreakStatement */); node.label = asName(label); return node; } @@ -70943,7 +70831,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236 /* ReturnStatement */); + var node = createSynthesizedNode(235 /* ReturnStatement */); node.expression = expression; return node; } @@ -70955,7 +70843,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237 /* WithStatement */); + var node = createSynthesizedNode(236 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70969,7 +70857,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238 /* SwitchStatement */); + var node = createSynthesizedNode(237 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70983,7 +70871,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239 /* LabeledStatement */); + var node = createSynthesizedNode(238 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70997,7 +70885,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240 /* ThrowStatement */); + var node = createSynthesizedNode(239 /* ThrowStatement */); node.expression = expression; return node; } @@ -71009,7 +70897,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241 /* TryStatement */); + var node = createSynthesizedNode(240 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -71025,12 +70913,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242 /* DebuggerStatement */); + return createSynthesizedNode(241 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71048,7 +70936,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71068,7 +70956,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* VariableDeclarationList */); + var node = createSynthesizedNode(243 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -71081,7 +70969,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245 /* FunctionDeclaration */); + var node = createSynthesizedNode(244 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -71107,7 +70995,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* ClassDeclaration */); + var node = createSynthesizedNode(245 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71129,7 +71017,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247 /* InterfaceDeclaration */); + var node = createSynthesizedNode(246 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71151,7 +71039,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71171,7 +71059,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249 /* EnumDeclaration */); + var node = createSynthesizedNode(248 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71190,7 +71078,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(250 /* ModuleDeclaration */); + var node = createSynthesizedNode(249 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -71209,7 +71097,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251 /* ModuleBlock */); + var node = createSynthesizedNode(250 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -71221,7 +71109,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252 /* CaseBlock */); + var node = createSynthesizedNode(251 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -71233,7 +71121,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -71245,7 +71133,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71263,7 +71151,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ImportDeclaration */); + var node = createSynthesizedNode(254 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -71282,7 +71170,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256 /* ImportClause */); + var node = createSynthesizedNode(255 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -71298,13 +71186,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257 /* NamespaceImport */); + var node = createSynthesizedNode(256 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263 /* NamespaceExport */); + var node = createSynthesizedNode(262 /* NamespaceExport */); node.name = name; return node; } @@ -71322,7 +71210,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258 /* NamedImports */); + var node = createSynthesizedNode(257 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -71334,7 +71222,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259 /* ImportSpecifier */); + var node = createSynthesizedNode(258 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -71348,7 +71236,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260 /* ExportAssignment */); + var node = createSynthesizedNode(259 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -71366,7 +71254,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261 /* ExportDeclaration */); + var node = createSynthesizedNode(260 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -71391,7 +71279,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262 /* NamedExports */); + var node = createSynthesizedNode(261 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -71403,7 +71291,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264 /* ExportSpecifier */); + var node = createSynthesizedNode(263 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -71418,7 +71306,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266 /* ExternalModuleReference */); + var node = createSynthesizedNode(265 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -71432,14 +71320,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295 /* JSDocTypeExpression */); + var node = createSynthesizedNode(294 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71447,7 +71335,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71455,14 +71343,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -71472,12 +71360,12 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocClassTag() { - return createJSDocTag(311 /* JSDocClassTag */, "class"); + return createJSDocTag(310 /* JSDocClassTag */, "class"); } ts.createJSDocClassTag = createJSDocClassTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304 /* JSDocComment */); + var node = createSynthesizedNode(303 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -71491,7 +71379,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267 /* JsxElement */); + var node = createSynthesizedNode(266 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -71507,7 +71395,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71523,7 +71411,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269 /* JsxOpeningElement */); + var node = createSynthesizedNode(268 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71539,7 +71427,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270 /* JsxClosingElement */); + var node = createSynthesizedNode(269 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -71551,7 +71439,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271 /* JsxFragment */); + var node = createSynthesizedNode(270 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -71573,11 +71461,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272 /* JsxOpeningFragment */); + return createSynthesizedNode(271 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273 /* JsxClosingFragment */); + return createSynthesizedNode(272 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71589,7 +71477,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274 /* JsxAttribute */); + var node = createSynthesizedNode(273 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71603,7 +71491,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275 /* JsxAttributes */); + var node = createSynthesizedNode(274 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71615,7 +71503,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71627,7 +71515,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277 /* JsxExpression */); + var node = createSynthesizedNode(276 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71641,7 +71529,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278 /* CaseClause */); + var node = createSynthesizedNode(277 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71655,7 +71543,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279 /* DefaultClause */); + var node = createSynthesizedNode(278 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71667,7 +71555,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280 /* HeritageClause */); + var node = createSynthesizedNode(279 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71680,7 +71568,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281 /* CatchClause */); + var node = createSynthesizedNode(280 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71695,7 +71583,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282 /* PropertyAssignment */); + var node = createSynthesizedNode(281 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71710,7 +71598,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71724,7 +71612,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284 /* SpreadAssignment */); + var node = createSynthesizedNode(283 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71737,7 +71625,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285 /* EnumMember */); + var node = createSynthesizedNode(284 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71758,7 +71646,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291 /* SourceFile */); + var updated = createSynthesizedNode(290 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71842,7 +71730,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326 /* NotEmittedStatement */); + var node = createSynthesizedNode(325 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71854,7 +71742,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71866,7 +71754,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71881,7 +71769,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71897,7 +71785,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328 /* CommaListExpression */) { + if (node.kind === 327 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71907,7 +71795,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328 /* CommaListExpression */); + var node = createSynthesizedNode(327 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71920,7 +71808,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71936,7 +71824,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292 /* Bundle */); + var node = ts.createNode(291 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71971,7 +71859,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293 /* UnparsedSource */); + var node = ts.createNode(292 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -72106,10 +71994,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; - case "internal" /* Internal */: return 289 /* UnparsedInternalText */; - case "text" /* Text */: return 288 /* UnparsedText */; + case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; + case "internal" /* Internal */: return 288 /* UnparsedInternalText */; + case "text" /* Text */: return 287 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -72127,14 +72015,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294 /* InputFiles */); + var node = ts.createNode(293 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -72331,7 +72219,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72878,7 +72766,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72897,13 +72785,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72911,7 +72799,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7 /* All */); + var callee = skipOuterExpressions(expression, 15 /* All */); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -72930,7 +72818,7 @@ var ts; } else { switch (callee.kind) { - case 195 /* PropertyAccessExpression */: { + case 194 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72943,7 +72831,7 @@ var ts; } break; } - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -73003,14 +72891,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -73336,7 +73224,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 201 /* ParenthesizedExpression */) { + if (skipped.kind === 200 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -73370,10 +73258,10 @@ 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(210 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -73385,7 +73273,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 213 /* YieldExpression */) { + && operand.kind === 212 /* YieldExpression */) { return false; } return true; @@ -73473,7 +73361,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -73486,7 +73374,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -73521,8 +73409,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: needsParens = true; } } @@ -73538,9 +73426,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return ts.createParen(expression); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -73563,7 +73451,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73601,7 +73489,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73612,29 +73500,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { + if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); + return recreateOuterExpressions(expression, mutableCall, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { + if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73642,9 +73530,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173 /* TypeQuery */: - case 185 /* TypeOperator */: - case 182 /* InferType */: + case 172 /* TypeQuery */: + case 184 /* TypeOperator */: + case 181 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73670,28 +73558,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: node = node.operand; continue; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: node = node.left; continue; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: node = node.condition; continue; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: node = node.tag; continue; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 218 /* AsExpression */: - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: - case 219 /* NonNullExpression */: - case 327 /* PartiallyEmittedExpression */: + case 217 /* AsExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 218 /* NonNullExpression */: + case 326 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73700,71 +73588,61 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 328 /* CommaListExpression */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 327 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; (function (OuterExpressionKinds) { OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + OuterExpressionKinds[OuterExpressionKinds["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds[OuterExpressionKinds["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All"; })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 219 /* NonNullExpression */: - return (kinds & 2 /* Assertions */) !== 0; - case 327 /* PartiallyEmittedExpression */: - return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + return (kinds & 2 /* TypeAssertions */) !== 0; + case 218 /* NonNullExpression */: + return (kinds & 4 /* NonNullAssertions */) !== 0; + case 326 /* PartiallyEmittedExpression */: + return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = ts.skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { + if (kinds === void 0) { kinds = 15 /* All */; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6 /* Assertions */); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73782,7 +73660,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 201 /* ParenthesizedExpression */ + return node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73790,7 +73668,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -73900,10 +73778,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -74022,7 +73900,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -74034,11 +73912,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -74070,12 +73948,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 156 /* Parameter */: + case 191 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 214 /* SpreadElement */: - case 284 /* SpreadAssignment */: + case 213 /* SpreadElement */: + case 283 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -74093,7 +73971,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192 /* BindingElement */: + case 191 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -74108,7 +73986,7 @@ var ts; : propertyName; } break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -74123,7 +74001,7 @@ var ts; : propertyName; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -74146,13 +74024,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -74192,11 +74070,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -74355,289 +74233,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158 /* Decorator */: + case 157 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163 /* Constructor */: + case 162 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176 /* TupleType */: + case 175 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* RestType */: + case 177 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* UnionType */: + case 178 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182 /* InferType */: + case 181 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187 /* MappedType */: + case 186 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 224 /* Block */: + case 223 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForStatement */: + case 230 /* ForStatement */: 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, ts.liftToBlock)); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74680,58 +74558,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { + if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 223 /* SemicolonClassElement */: - case 225 /* EmptyStatement */: - case 216 /* OmittedExpression */: - case 242 /* DebuggerStatement */: - case 326 /* NotEmittedStatement */: + case 222 /* SemicolonClassElement */: + case 224 /* EmptyStatement */: + case 215 /* OmittedExpression */: + case 241 /* DebuggerStatement */: + case 325 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 157 /* Parameter */: + case 156 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158 /* Decorator */: + case 157 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74740,12 +74618,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* Constructor */: + case 162 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74753,7 +74631,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74761,50 +74639,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* NewExpression */: + case 197 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74812,123 +74690,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201 /* ParenthesizedExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218 /* AsExpression */: + case 217 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 224 /* Block */: + case 223 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 230 /* WhileStatement */: - case 237 /* WithStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74937,7 +74815,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74945,143 +74823,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -75154,7 +75032,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75828,7 +75706,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75879,7 +75757,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75892,13 +75770,13 @@ var ts; hasImportDefault = true; } break; - case 254 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + case 253 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75929,13 +75807,13 @@ var ts; } } break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75943,7 +75821,7 @@ var ts; } } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75963,7 +75841,7 @@ var ts; } } break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -76142,7 +76020,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 160 /* PropertyDeclaration */ + return member.kind === 159 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76771,8 +76649,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76798,14 +76676,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76856,16 +76734,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 251 /* ModuleBlock */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 250 /* ModuleBlock */: + case 223 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76877,7 +76755,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76920,10 +76798,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76944,13 +76822,13 @@ var ts; return node; } switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76970,11 +76848,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 261 /* ExportDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 256 /* ImportClause */ || - (node.kind === 254 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 266 /* ExternalModuleReference */)) { + if (node.kind === 260 /* ExportDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 255 /* ImportClause */ || + (node.kind === 253 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 265 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76998,19 +76876,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -77046,62 +76924,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: - case 139 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 174 /* TypeLiteral */: - case 169 /* TypePredicate */: - case 156 /* TypeParameter */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 173 /* TypeLiteral */: + case 168 /* TypePredicate */: + case 155 /* TypeParameter */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 129 /* BooleanKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 128 /* BooleanKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 137 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 145 /* SymbolKeyword */: - case 172 /* ConstructorType */: - case 171 /* FunctionType */: - case 173 /* TypeQuery */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 183 /* ParenthesizedType */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: + case 144 /* SymbolKeyword */: + case 171 /* ConstructorType */: + case 170 /* FunctionType */: + case 172 /* TypeQuery */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 182 /* ParenthesizedType */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 158 /* Decorator */: + case 157 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77111,7 +76989,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77121,35 +76999,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -77159,35 +77037,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77600,12 +77478,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77758,7 +77636,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 160 /* PropertyDeclaration */ + ? member.kind === 159 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77881,10 +77759,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 160 /* PropertyDeclaration */; + return kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 159 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77894,7 +77772,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77905,12 +77783,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; } return false; @@ -77927,15 +77805,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: return serializeTypeNode(node.type); - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77972,7 +77850,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164 /* GetAccessor */) { + if (container && node.kind === 163 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -78018,30 +77896,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return ts.createVoidZero(); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createIdentifier("Function"); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return ts.createIdentifier("Array"); - case 169 /* TypePredicate */: - case 129 /* BooleanKeyword */: + case 168 /* TypePredicate */: + case 128 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return ts.createIdentifier("String"); - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -78052,34 +77930,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return serializeTypeReferenceNode(node); - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return serializeTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 185 /* TypeOperator */: - if (node.operator === 139 /* ReadonlyKeyword */) { + case 184 /* TypeOperator */: + if (node.operator === 138 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 173 /* TypeQuery */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 174 /* TypeLiteral */: + case 172 /* TypeQuery */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 173 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 184 /* ThisType */: - case 189 /* ImportType */: + case 148 /* UnknownKeyword */: + case 183 /* ThisType */: + case 188 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -78092,13 +77970,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -78207,7 +78085,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78527,7 +78405,7 @@ var ts; /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2 /* Assertions */); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */); if (ts.isAssertionExpression(innerExpression)) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; @@ -78767,12 +78645,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 249 /* EnumDeclaration */) { + if (node.kind === 248 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78897,7 +78775,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251 /* ModuleBlock */) { + if (body.kind === 250 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78943,13 +78821,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 251 /* ModuleBlock */) { + if (body.kind !== 250 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78999,7 +78877,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 257 /* NamespaceImport */) { + if (node.kind === 256 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -79247,16 +79125,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(250 /* ModuleDeclaration */); + context.enableEmitNotification(249 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; } /** * Hook for node emit. @@ -79317,9 +79195,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -79357,9 +79235,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 291 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); + if (container && container.kind !== 290 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -79510,40 +79388,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return visitClassLike(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194 /* ObjectLiteralExpression */: - case 193 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -79566,20 +79444,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -80345,31 +80223,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80378,27 +80256,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 224 /* Block */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 237 /* WithStatement */: - case 239 /* LabeledStatement */: + case 223 /* Block */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 236 /* WithStatement */: + case 238 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80603,7 +80481,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203 /* ArrowFunction */; + var isArrowFunction = node.kind === 202 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80694,17 +80572,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -80752,11 +80630,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80788,11 +80666,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80960,64 +80838,64 @@ var ts; return node; } switch (node.kind) { - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitVoidExpression(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -81051,7 +80929,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -81063,7 +80941,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284 /* SpreadAssignment */) { + if (e.kind === 283 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -81072,7 +80950,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -81106,7 +80984,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -81484,17 +81362,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -81542,11 +81420,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -81578,11 +81456,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81680,7 +81558,7 @@ var ts; return node; } switch (node.kind) { - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81712,30 +81590,32 @@ var ts; return node; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -81766,7 +81646,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 /* PropertyAccessExpression */ + expression = node.kind === 194 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81780,10 +81660,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81802,8 +81682,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81813,11 +81693,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 /* PropertyAccessExpression */ + rightExpression = segment.kind === 194 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81915,13 +81795,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81931,13 +81811,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -82012,7 +81892,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277 /* JsxExpression */) { + else if (node.kind === 276 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -82106,7 +81986,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267 /* JsxElement */) { + if (node.kind === 266 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -82412,7 +82292,7 @@ var ts; return node; } switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82625,13 +82505,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 236 /* ReturnStatement */ + && node.kind === 235 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82653,63 +82533,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return visitClassExpression(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82720,28 +82600,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitMetaProperty(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82832,14 +82712,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82850,7 +82730,7 @@ var ts; } } else { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -83246,11 +83126,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 236 /* ReturnStatement */) { + if (statement.kind === 235 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 228 /* IfStatement */) { + else if (statement.kind === 227 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -83258,7 +83138,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 224 /* Block */) { + else if (statement.kind === 223 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -83456,7 +83336,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -83477,22 +83357,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return statements; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -83524,20 +83404,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83739,7 +83619,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83783,7 +83663,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203 /* ArrowFunction */); + ts.Debug.assert(node.kind === 202 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83851,9 +83731,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83872,9 +83752,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -84088,14 +83968,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -84283,7 +84163,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155 /* ComputedPropertyName */) { + if (property.name.kind === 154 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -84404,11 +84284,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -84433,11 +84313,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84836,20 +84716,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84956,7 +84836,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -85448,13 +85328,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(163 /* Constructor */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(203 /* ArrowFunction */); - context.enableEmitNotification(202 /* FunctionExpression */); - context.enableEmitNotification(245 /* FunctionDeclaration */); + context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(202 /* ArrowFunction */); + context.enableEmitNotification(201 /* FunctionExpression */); + context.enableEmitNotification(244 /* FunctionDeclaration */); } } /** @@ -85495,10 +85375,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 242 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -85580,11 +85460,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85592,7 +85472,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85632,15 +85512,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269 /* JsxOpeningElement */); - context.enableEmitNotification(270 /* JsxClosingElement */); - context.enableEmitNotification(268 /* JsxSelfClosingElement */); + context.enableEmitNotification(268 /* JsxOpeningElement */); + context.enableEmitNotification(269 /* JsxClosingElement */); + context.enableEmitNotification(267 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(282 /* PropertyAssignment */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(281 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85659,9 +85539,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85996,13 +85876,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -86015,24 +85895,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return visitBreakStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return visitContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -86053,21 +85933,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitConditionalExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -86080,9 +85960,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -86290,7 +86170,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -86302,7 +86182,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86678,35 +86558,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: return transformAndEmitBlock(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return transformAndEmitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return transformAndEmitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return transformAndEmitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return transformAndEmitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -87136,7 +87016,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -87149,7 +87029,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -88378,11 +88258,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88706,23 +88586,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88749,24 +88629,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -89266,7 +89146,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -89321,10 +89201,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -89537,7 +89417,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89601,10 +89481,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89625,7 +89505,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89700,7 +89580,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89799,12 +89679,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -90028,7 +89908,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -90053,7 +89933,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261 /* ExportDeclaration */) { + if (externalImport.kind !== 260 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -90136,19 +90016,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -90207,13 +90087,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -90393,7 +90273,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -90457,7 +90337,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -90519,10 +90399,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90702,43 +90582,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitDefaultClause(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitTryStatement(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90985,7 +90865,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291 /* SourceFile */; + return container !== undefined && container.kind === 290 /* SourceFile */; } else { return false; @@ -91018,7 +90898,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -91068,7 +90948,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -91104,12 +90984,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -91202,14 +91082,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209 /* PostfixUnaryExpression */) { + if (node.kind === 208 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -91237,7 +91117,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -91276,7 +91156,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291 /* SourceFile */); + context.enableEmitNotification(290 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -91301,12 +91181,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -91437,7 +91317,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91466,7 +91346,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91513,7 +91393,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91522,8 +91402,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || - (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || + (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -91532,7 +91412,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 === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { + else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91557,7 +91437,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91596,26 +91476,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have return types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have return types that cannot be named 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 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91623,7 +91503,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91637,7 +91517,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91662,30 +91542,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 167 /* ConstructSignature */: - case 172 /* ConstructorType */: + case 166 /* ConstructSignature */: + case 171 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91693,7 +91573,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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91706,15 +91586,15 @@ 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 245 /* FunctionDeclaration */: - case 171 /* FunctionType */: + case 244 /* FunctionDeclaration */: + case 170 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91728,39 +91608,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187 /* MappedType */: + case 186 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { 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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { 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 171 /* FunctionType */: - case 245 /* FunctionDeclaration */: + case 170 /* FunctionType */: + case 244 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91775,7 +91655,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 246 /* ClassDeclaration */) { + if (node.parent.parent.kind === 245 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91826,7 +91706,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91985,10 +91865,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -92011,14 +91891,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -92159,7 +92039,7 @@ var ts; return name; } else { - if (name.kind === 191 /* ArrayBindingPattern */) { + if (name.kind === 190 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -92167,7 +92047,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216 /* OmittedExpression */) { + if (elem.kind === 215 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -92205,7 +92085,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 157 /* Parameter */ && + var shouldUseResolverType = node.kind === 156 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -92214,7 +92094,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -92225,12 +92105,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 /* Parameter */ - || node.kind === 160 /* PropertyDeclaration */ - || node.kind === 159 /* PropertySignature */) { + if (node.kind === 156 /* Parameter */ + || node.kind === 159 /* PropertyDeclaration */ + || node.kind === 158 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -92247,20 +92127,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return false; } return false; @@ -92341,7 +92221,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -92361,7 +92241,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -92388,7 +92268,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -92477,7 +92357,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -92498,38 +92378,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217 /* ExpressionWithTypeArguments */: { + case 216 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170 /* TypeReference */: { + case 169 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163 /* Constructor */: { + case 162 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162 /* MethodDeclaration */: { + case 161 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164 /* GetAccessor */: { + case 163 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92538,7 +92418,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 165 /* SetAccessor */: { + case 164 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92546,31 +92426,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161 /* MethodSignature */: { + case 160 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166 /* CallSignature */: { + case 165 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168 /* IndexSignature */: { + case 167 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -92578,13 +92458,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156 /* TypeParameter */: { + case 155 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181 /* ConditionalType */: { + case 180 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92596,13 +92476,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171 /* FunctionType */: { + case 170 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172 /* ConstructorType */: { + case 171 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189 /* ImportType */: { + case 188 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92631,7 +92511,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92641,7 +92521,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261 /* ExportDeclaration */: { + case 260 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92651,7 +92531,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92667,7 +92547,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92692,10 +92572,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92716,14 +92596,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247 /* InterfaceDeclaration */: { + case 246 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245 /* FunctionDeclaration */: { + case 244 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92771,10 +92651,10 @@ var ts; return clean; } } - case 250 /* ModuleDeclaration */: { + case 249 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251 /* ModuleBlock */) { + if (inner && inner.kind === 250 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92817,7 +92697,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 246 /* ClassDeclaration */: { + case 245 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92878,7 +92758,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92898,10 +92778,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 249 /* EnumDeclaration */: { + case 248 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92920,7 +92800,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250 /* ModuleDeclaration */) { + if (input.kind === 249 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92941,7 +92821,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216 /* OmittedExpression */) { + if (e.kind === 215 /* OmittedExpression */) { return; } if (e.name) { @@ -92991,7 +92871,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 291 /* SourceFile */; + var parentIsFile = node.parent.kind === 290 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -93020,7 +92900,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { return true; } return false; @@ -93045,7 +92925,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 /* GetAccessor */ + return accessor.kind === 163 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -93054,52 +92934,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 226 /* VariableStatement */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 225 /* VariableStatement */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 243 /* VariableDeclaration */: - case 156 /* TypeParameter */: - case 217 /* ExpressionWithTypeArguments */: - case 170 /* TypeReference */: - case 181 /* ConditionalType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 189 /* ImportType */: + case 166 /* ConstructSignature */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 242 /* VariableDeclaration */: + case 155 /* TypeParameter */: + case 216 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 180 /* ConditionalType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 188 /* ImportType */: return true; } return false; @@ -93232,7 +93112,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332 /* Count */); + var enabledSyntaxKindFeatures = new Array(331 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93596,7 +93476,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292 /* Bundle */) { + if (sourceFile.kind === 291 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93926,7 +93806,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93949,8 +93829,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93991,7 +93871,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -94102,7 +93982,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -94114,7 +93994,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -94292,9 +94172,9 @@ var ts; break; } switch (node.kind) { - case 291 /* SourceFile */: return printFile(node); - case 292 /* Bundle */: return printBundle(node); - case 293 /* UnparsedSource */: return printUnparsedSource(node); + case 290 /* SourceFile */: return printFile(node); + case 291 /* Bundle */: return printBundle(node); + case 292 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -94550,12 +94430,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94597,15 +94477,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 293 /* UnparsedSource */: - case 287 /* UnparsedPrepend */: + case 292 /* UnparsedSource */: + case 286 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 286 /* UnparsedPrologue */: + case 285 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 290 /* UnparsedSyntheticReference */: + case 289 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94615,260 +94495,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return emitQualifiedName(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return emitTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return emitParameter(node); - case 158 /* Decorator */: + case 157 /* Decorator */: return emitDecorator(node); // Type members - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return emitPropertySignature(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return emitMethodSignature(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return emitConstructor(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return emitAccessorDeclaration(node); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return emitCallSignature(node); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return emitConstructSignature(node); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return emitIndexSignature(node); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return emitTypePredicate(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return emitTypeReference(node); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return emitFunctionType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return emitConstructorType(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return emitTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return emitTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return emitArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return emitTupleType(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return emitOptionalType(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return emitUnionType(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return emitIntersectionType(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return emitConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return emitInferType(node); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return emitParenthesizedType(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return emitThisType(); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return emitTypeOperator(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return emitMappedType(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return emitLiteralType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return emitImportTypeNode(node); - case 296 /* JSDocAllType */: + case 295 /* JSDocAllType */: writePunctuation("*"); return; - case 297 /* JSDocUnknownType */: + case 296 /* JSDocUnknownType */: writePunctuation("?"); return; - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 178 /* RestType */: - case 302 /* JSDocVariadicType */: + case 177 /* RestType */: + case 301 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return emitBindingElement(node); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return emitTemplateSpan(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 224 /* Block */: + case 223 /* Block */: return emitBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return emitVariableStatement(node); - case 225 /* EmptyStatement */: + case 224 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return emitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return emitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return emitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return emitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return emitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return emitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return emitForOfStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return emitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return emitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return emitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return emitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return emitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return emitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return emitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return emitTryStatement(node); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return emitClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return emitModuleBlock(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return emitCaseBlock(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return emitImportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return emitImportClause(node); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return emitNamespaceImport(node); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return emitNamespaceExport(node); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return emitNamedImports(node); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return emitImportSpecifier(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return emitExportDeclaration(node); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return emitNamedExports(node); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return emitExportSpecifier(node); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 270 /* JsxClosingElement */: - case 273 /* JsxClosingFragment */: + case 269 /* JsxClosingElement */: + case 272 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return emitJsxAttribute(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return emitJsxAttributes(node); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return emitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return emitDefaultClause(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return emitHeritageClause(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 309 /* JSDocImplementsTag */: - case 308 /* JSDocAugmentsTag */: + case 308 /* JSDocImplementsTag */: + case 307 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return emitJSDocSignature(node); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 311 /* JSDocClassTag */: - case 307 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 306 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94905,71 +94785,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return emitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return emitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return emitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return emitArrowFunction(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return emitDeleteExpression(node); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return emitVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return emitAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return emitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return emitConditionalExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return emitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return emitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return emitSpreadExpression(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return emitClassExpression(node); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return; - case 218 /* AsExpression */: + case 217 /* AsExpression */: return emitAsExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return emitNonNullExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return emitJsxElement(node); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return emitCommaList(node); } } @@ -95011,7 +94891,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 /* Bundle */ ? node : undefined; + var bundle = node.kind === 291 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -95111,7 +94991,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -95184,7 +95064,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -95246,7 +95126,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -95429,7 +95309,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -95663,7 +95543,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 208 /* PrefixUnaryExpression */ + return operand.kind === 207 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95851,7 +95731,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228 /* IfStatement */) { + if (node.elseStatement.kind === 227 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95914,7 +95794,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95922,7 +95802,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { emit(node); } else { @@ -96218,7 +96098,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250 /* ModuleDeclaration */) { + while (body.kind === 249 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -96263,7 +96143,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -96271,7 +96151,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -96311,7 +96191,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -96323,7 +96203,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -96334,7 +96214,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -96554,7 +96434,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -96588,7 +96468,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96607,7 +96487,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -97427,7 +97307,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -97492,84 +97372,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: ts.forEach(node.statements, generateNames); break; - case 239 /* LabeledStatement */: - case 237 /* WithStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 238 /* LabeledStatement */: + case 236 /* WithStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: generateNames(node.statement); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: generateNames(node.declarationList); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: generateNames(node.importClause); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -97578,12 +97458,12 @@ var ts; if (!node) return; switch (node.kind) { - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97765,23 +97645,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 259 /* ExportAssignment */: return generateNameForExportDefault(); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return generateNameForClassExpression(); - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97829,7 +97709,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97853,7 +97733,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -98112,7 +97992,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -98125,7 +98005,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -100151,22 +100031,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 243 /* VariableDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 242 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -100174,58 +100054,58 @@ var ts; } } switch (node.kind) { - case 256 /* ImportClause */: + case 255 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); + case 249 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218 /* AsExpression */: + case 217 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -100234,29 +100114,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); return "skip"; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -100268,19 +100148,19 @@ var ts; return "skip"; } break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: - case 199 /* TaggedTemplateExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 198 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -100302,8 +100182,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: - case 131 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -107344,37 +107224,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 281 /* CatchClause */: - case 274 /* JsxAttribute */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 280 /* CatchClause */: + case 273 /* JsxAttribute */: return 1 /* Value */; - case 156 /* TypeParameter */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 174 /* TypeLiteral */: + case 155 /* TypeParameter */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 173 /* TypeLiteral */: return 2 /* Type */; - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 285 /* EnumMember */: - case 246 /* ClassDeclaration */: + case 284 /* EnumMember */: + case 245 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -107384,16 +107264,16 @@ var ts; else { return 4 /* Namespace */; } - case 249 /* EnumDeclaration */: - case 258 /* NamedImports */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 248 /* EnumDeclaration */: + case 257 /* NamedImports */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -107401,10 +107281,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { + else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -107436,11 +107316,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -107452,27 +107332,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 154 /* QualifiedName */) { - while (root.parent && root.parent.kind === 154 /* QualifiedName */) { + if (root.parent.kind === 153 /* QualifiedName */) { + while (root.parent && root.parent.kind === 153 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 170 /* TypeReference */ && !isLastClause; + return root.parent.kind === 169 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 195 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { + if (root.parent.kind === 194 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -107483,15 +107363,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return true; } switch (node.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return true; - case 189 /* ImportType */: + case 188 /* ImportType */: return !node.parent.isTypeOf; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -107558,7 +107438,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -107619,22 +107499,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 250 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 249 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return true; - case 188 /* LiteralType */: - return node.parent.parent.kind === 186 /* IndexedAccessType */; + case 187 /* LiteralType */: + return node.parent.parent.kind === 185 /* IndexedAccessType */; default: return false; } @@ -107658,17 +107538,17 @@ var ts; return undefined; } switch (node.kind) { - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return node; } } @@ -107676,54 +107556,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return "class" /* classElement */; - case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 248 /* TypeAliasDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 247 /* TypeAliasDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 249 /* EnumDeclaration */: return "enum" /* enumElement */; - case 243 /* VariableDeclaration */: + case 248 /* EnumDeclaration */: return "enum" /* enumElement */; + case 242 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return "function" /* functionElement */; - case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 166 /* CallSignature */: return "call" /* callSignatureElement */; - case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: + case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 165 /* CallSignature */: return "call" /* callSignatureElement */; + case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: return "alias" /* alias */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -107752,7 +107632,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -107775,7 +107655,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; default: return false; } @@ -107840,42 +107720,42 @@ var ts; return false; } switch (n.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 190 /* ObjectBindingPattern */: - case 174 /* TypeLiteral */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 252 /* CaseBlock */: - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 173 /* TypeLiteral */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 251 /* CaseBlock */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 198 /* NewExpression */: + case 197 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 197 /* CallExpression */: - case 201 /* ParenthesizedExpression */: - case 183 /* ParenthesizedType */: + case 196 /* CallExpression */: + case 200 /* ParenthesizedExpression */: + case 182 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 202 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107885,65 +107765,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 193 /* ArrayLiteralExpression */: - case 191 /* ArrayBindingPattern */: - case 196 /* ElementAccessExpression */: - case 155 /* ComputedPropertyName */: - case 176 /* TupleType */: + case 192 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 195 /* ElementAccessExpression */: + case 154 /* ComputedPropertyName */: + case 175 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 205 /* TypeOfExpression */: - case 204 /* DeleteExpression */: - case 206 /* VoidExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: + case 204 /* TypeOfExpression */: + case 203 /* DeleteExpression */: + case 205 /* VoidExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -108050,11 +107930,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -108149,11 +108029,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -108167,7 +108047,7 @@ var ts; return decl.name; } } - if (node.kind === 146 /* TypeKeyword */) { + if (node.kind === 145 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -108234,12 +108114,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -108264,7 +108144,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -108272,12 +108152,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && + if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && + if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -108314,7 +108194,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -108455,7 +108335,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -108525,17 +108405,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { return true; } return false; @@ -108600,7 +108480,7 @@ var ts; function getPossibleGenericSignatures(called, typeArgumentCount, checker) { var type = checker.getTypeAtLocation(called); if (ts.isOptionalChain(called.parent)) { - type = removeOptionality(type, !!called.parent.questionDotToken, /*isOptionalChain*/ true); + type = removeOptionality(type, ts.isOptionalChainRoot(called.parent), /*isOptionalChain*/ true); } var signatures = ts.isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); return signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; }); @@ -108676,7 +108556,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -108731,16 +108611,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 260 /* ExportAssignment */) + if (node.kind === 259 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { + if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -108785,18 +108665,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 193 /* ArrayLiteralExpression */ || - node.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 192 /* ArrayLiteralExpression */ || + node.kind === 193 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 210 /* BinaryExpression */ && + if (node.parent.kind === 209 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 233 /* ForOfStatement */ && + if (node.parent.kind === 232 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -108804,7 +108684,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -108850,29 +108730,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 152 /* BigIntKeyword */, - 129 /* BooleanKeyword */, + 151 /* BigIntKeyword */, + 128 /* BooleanKeyword */, 91 /* FalseKeyword */, - 135 /* KeyOfKeyword */, - 138 /* NeverKeyword */, + 134 /* KeyOfKeyword */, + 137 /* NeverKeyword */, 100 /* NullKeyword */, - 141 /* NumberKeyword */, - 142 /* ObjectKeyword */, - 139 /* ReadonlyKeyword */, - 144 /* StringKeyword */, - 145 /* SymbolKeyword */, + 140 /* NumberKeyword */, + 141 /* ObjectKeyword */, + 138 /* ReadonlyKeyword */, + 143 /* StringKeyword */, + 144 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 147 /* UndefinedKeyword */, - 148 /* UniqueKeyword */, - 149 /* UnknownKeyword */, + 146 /* UndefinedKeyword */, + 147 /* UniqueKeyword */, + 148 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 146 /* TypeKeyword */; + return node.kind === 145 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108905,7 +108785,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 155 /* ComputedPropertyName */ + return name.kind === 154 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -109065,7 +108945,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -109111,7 +108991,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -109575,15 +109455,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checker.getContextualType(parent); - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 278 /* CaseClause */: + case 277 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -109622,8 +109502,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 199 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: return true; default: return false; @@ -109656,41 +109536,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 166 /* CallSignature */ - || kind === 167 /* ConstructSignature */ - || kind === 168 /* IndexSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */; + return kind === 165 /* CallSignature */ + || kind === 166 /* ConstructSignature */ + || kind === 167 /* IndexSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 244 /* FunctionDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 250 /* ModuleDeclaration */; + return kind === 249 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 226 /* VariableStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 229 /* DoStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 235 /* BreakStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 160 /* PropertyDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 260 /* ExportAssignment */; + return kind === 225 /* VariableStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 228 /* DoStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 234 /* BreakStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 159 /* PropertyDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 259 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -109720,7 +109600,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 229 /* DoStatement */) { + if (node.kind === 228 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -110087,10 +109967,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -110279,9 +110159,9 @@ var ts; return true; } switch (keyword2) { - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - case 130 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + case 129 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -110422,10 +110302,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -110645,18 +110525,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -110807,22 +110687,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -110851,17 +110731,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 243 /* VariableDeclaration */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 157 /* Parameter */ || - parent.kind === 274 /* JsxAttribute */) { + if (parent.kind === 242 /* VariableDeclaration */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 156 /* Parameter */ || + parent.kind === 273 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 210 /* BinaryExpression */ || - parent.kind === 208 /* PrefixUnaryExpression */ || - parent.kind === 209 /* PostfixUnaryExpression */ || - parent.kind === 211 /* ConditionalExpression */) { + if (parent.kind === 209 /* BinaryExpression */ || + parent.kind === 207 /* PrefixUnaryExpression */ || + parent.kind === 208 /* PostfixUnaryExpression */ || + parent.kind === 210 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110874,7 +110754,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110890,32 +110770,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 157 /* Parameter */: + case 156 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -111039,11 +110919,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (parent.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -111051,9 +110931,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 189 /* ImportType */: + case 188 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 179 /* UnionType */: { + case 178 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -111063,7 +110943,7 @@ var ts; default: return undefined; } - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -111080,7 +110960,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -111093,8 +110973,8 @@ var ts; } return undefined; } - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -111103,9 +110983,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 266 /* ExternalModuleReference */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 265 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -112056,11 +111936,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -112070,7 +111950,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -112089,7 +111969,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -112140,11 +112020,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -112196,7 +112076,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -112208,14 +112088,14 @@ var ts; return undefined; } break; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: node = parent.left; break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: node = parent.name; break; - case 189 /* ImportType */: - case 220 /* MetaProperty */: + case 188 /* ImportType */: + case 219 /* MetaProperty */: node = parent; break; default: @@ -112228,7 +112108,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 195 /* PropertyAccessExpression */) { + if (parent && parent.kind === 194 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -112236,38 +112116,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: + case 268 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -112347,11 +112227,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 323 /* JSDocTypedefTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 322 /* JSDocTypedefTag */: return true; default: return false; @@ -112396,7 +112276,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -112443,7 +112323,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -112599,7 +112479,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -112649,10 +112529,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 291 /* SourceFile */: - case 212 /* TemplateExpression */: - case 277 /* JsxExpression */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 211 /* TemplateExpression */: + case 276 /* JsxExpression */: + case 223 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -112698,27 +112578,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 160 /* PropertyDeclaration */ || - parentKind === 159 /* PropertySignature */ || - parentKind === 157 /* Parameter */ || - parentKind === 243 /* VariableDeclaration */ || + return parentKind === 159 /* PropertyDeclaration */ || + parentKind === 158 /* PropertySignature */ || + parentKind === 156 /* Parameter */ || + parentKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 248 /* TypeAliasDeclaration */; + return parentKind === 247 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 218 /* AsExpression */; + return parentKind === 217 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 170 /* TypeReference */ || - parentKind === 200 /* TypeAssertionExpression */; + return parentKind === 169 /* TypeReference */ || + parentKind === 199 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 156 /* TypeParameter */; + return parentKind === 155 /* TypeParameter */; } } return false; @@ -112929,7 +112809,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112939,10 +112819,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 269 /* JsxOpeningElement */; + return location.parent.kind !== 268 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; + if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; } } return false; @@ -112953,40 +112833,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 197 /* CallExpression */ // func( a, | - || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 198 /* NewExpression */ // new C(a, | - || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 196 /* CallExpression */ // func( a, | + || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 197 /* NewExpression */ // new C(a, | + || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 197 /* CallExpression */ // func( | - || containingNodeKind === 163 /* Constructor */ // constructor( | - || containingNodeKind === 198 /* NewExpression */ // new C(a| - || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 196 /* CallExpression */ // func( | + || containingNodeKind === 162 /* Constructor */ // constructor( | + || containingNodeKind === 197 /* NewExpression */ // new C(a| + || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 136 /* ModuleKeyword */: // module | - case 137 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 135 /* ModuleKeyword */: // module | + case 136 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 210 /* BinaryExpression */; // x = a| + return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 209 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -113013,7 +112893,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -113023,7 +112903,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -113034,12 +112914,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -113089,7 +112969,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -113211,11 +113091,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: - case 275 /* JsxAttributes */: - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { + case 194 /* PropertyAccessExpression */: + case 274 /* JsxAttributes */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -113223,7 +113103,7 @@ var ts; } return parent; } - else if (parent.kind === 274 /* JsxAttribute */) { + else if (parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113235,7 +113115,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113245,8 +113125,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 277 /* JsxExpression */ && - parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { + parent.kind === 276 /* JsxExpression */ && + parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113254,7 +113134,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113274,51 +113154,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 243 /* VariableDeclaration */ || + return containingNodeKind === 242 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 226 /* VariableStatement */ || - containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 225 /* VariableStatement */ || + containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 192 /* BindingElement */; // var {x :html| + return containingNodeKind === 191 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 281 /* CatchClause */ || + return containingNodeKind === 280 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | - containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | + containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 157 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 156 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 259 /* ImportSpecifier */ || - containingNodeKind === 264 /* ExportSpecifier */ || - containingNodeKind === 257 /* NamespaceImport */; - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + return containingNodeKind === 258 /* ImportSpecifier */ || + containingNodeKind === 263 /* ExportSpecifier */ || + containingNodeKind === 256 /* NamespaceImport */; + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -113329,7 +113209,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 146 /* TypeKeyword */: // type htm| + case 145 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -113355,7 +113235,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -113377,7 +113257,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -113387,7 +113267,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ + return node.parent.kind === 243 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -113405,13 +113285,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 282 /* PropertyAssignment */ && - m.kind !== 283 /* ShorthandPropertyAssignment */ && - m.kind !== 192 /* BindingElement */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */ && - m.kind !== 284 /* SpreadAssignment */) { + if (m.kind !== 281 /* PropertyAssignment */ && + m.kind !== 282 /* ShorthandPropertyAssignment */ && + m.kind !== 191 /* BindingElement */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */ && + m.kind !== 283 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113482,10 +113362,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 160 /* PropertyDeclaration */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */) { + if (m.kind !== 159 /* PropertyDeclaration */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113526,7 +113406,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 274 /* JsxAttribute */) { + if (attr.kind === 273 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -113576,7 +113456,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -113602,12 +113482,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 131 /* DeclareKeyword */ - || kind === 136 /* ModuleKeyword */ - || kind === 146 /* TypeKeyword */ - || kind === 137 /* NamespaceKeyword */ + || kind === 130 /* DeclareKeyword */ + || kind === 135 /* ModuleKeyword */ + || kind === 145 /* TypeKeyword */ + || kind === 136 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -113629,46 +113509,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 131 /* DeclareKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 134 /* IsKeyword */: - case 135 /* KeyOfKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 138 /* NeverKeyword */: - case 141 /* NumberKeyword */: - case 142 /* ObjectKeyword */: + case 133 /* IsKeyword */: + case 134 /* KeyOfKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 137 /* NeverKeyword */: + case 140 /* NumberKeyword */: + case 141 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: - case 144 /* StringKeyword */: - case 145 /* SymbolKeyword */: - case 146 /* TypeKeyword */: - case 148 /* UniqueKeyword */: - case 149 /* UnknownKeyword */: + case 138 /* ReadonlyKeyword */: + case 143 /* StringKeyword */: + case 144 /* SymbolKeyword */: + case 145 /* TypeKeyword */: + case 147 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 139 /* ReadonlyKeyword */; + return kind === 138 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 130 /* ConstructorKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 129 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -113727,7 +113607,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 325 /* SyntaxList */: + case 324 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113895,11 +113775,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 130 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); + case 129 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113947,7 +113827,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113979,16 +113859,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 238 /* SwitchStatement */: - if (statement.kind === 234 /* ContinueStatement */) { + case 237 /* SwitchStatement */: + if (statement.kind === 233 /* ContinueStatement */) { return false; } // falls through - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -114004,11 +113884,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 224 /* Block */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 223 /* Block */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -114016,14 +113896,14 @@ var ts; else { return container.statements; } - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 173 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -114056,7 +113936,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 229 /* DoStatement */) { + if (loopNode.kind === 228 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -114076,13 +113956,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -114449,10 +114329,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -114465,20 +114345,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -114488,7 +114368,7 @@ var ts; directImports.push(direct); } break; - case 189 /* ImportType */: + case 188 /* ImportType */: directImports.push(direct); break; default: @@ -114505,7 +114385,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -114562,7 +114442,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 254 /* ImportEqualsDeclaration */) { + if (decl.kind === 253 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -114572,7 +114452,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 189 /* ImportType */) { + if (decl.kind === 188 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -114588,7 +114468,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 261 /* ExportDeclaration */) { + if (decl.kind === 260 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -114597,10 +114477,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -114650,7 +114530,7 @@ var ts; } } else { - var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -114679,7 +114559,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 291 /* SourceFile */) { + if (searchSourceFile.kind === 290 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -114727,7 +114607,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -114742,15 +114622,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: { + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -114774,7 +114654,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 195 /* PropertyAccessExpression */) { + if (parent.kind === 194 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114904,13 +114784,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114943,21 +114823,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 291 /* SourceFile */) { + if (parent.kind === 290 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -115059,7 +114939,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -115067,27 +114947,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextNode(node.parent.parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -115148,13 +115028,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -115304,13 +115184,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 215 /* ClassExpression */) { + else if (node.kind === 214 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -115360,7 +115240,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -115371,47 +115251,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 210 /* BinaryExpression */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 209 /* BinaryExpression */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 264 /* ExportSpecifier */: - case 256 /* ImportClause */: // default import - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 247 /* InterfaceDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 274 /* JsxAttribute */: - case 250 /* ModuleDeclaration */: - case 253 /* NamespaceExportDeclaration */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: - case 157 /* Parameter */: - case 283 /* ShorthandPropertyAssignment */: - case 248 /* TypeAliasDeclaration */: - case 156 /* TypeParameter */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 263 /* ExportSpecifier */: + case 255 /* ImportClause */: // default import + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 246 /* InterfaceDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 273 /* JsxAttribute */: + case 249 /* ModuleDeclaration */: + case 252 /* NamespaceExportDeclaration */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: + case 156 /* Parameter */: + case 282 /* ShorthandPropertyAssignment */: + case 247 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: return true; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return !!decl.body; - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 161 /* MethodSignature */: - case 159 /* PropertySignature */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 160 /* MethodSignature */: + case 158 /* PropertySignature */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -115572,10 +115452,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -115604,9 +115484,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 139 /* ReadonlyKeyword */ + return node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 139 /* ReadonlyKeyword */; + && node.parent.operator === 138 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -115617,12 +115497,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -115683,7 +115563,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115923,7 +115803,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115933,7 +115813,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115962,7 +115842,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -116333,15 +116213,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 162 /* MethodDeclaration */) { + if (decl && decl.kind === 161 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -116365,7 +116245,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 163 /* Constructor */); + ts.Debug.assert(decl.kind === 162 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -116395,7 +116275,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -116415,7 +116295,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 224 /* Block */) { + if (body.kind === 223 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -116443,13 +116323,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 193 /* ArrayLiteralExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 192 /* ArrayLiteralExpression */: return true; default: return false; @@ -116502,13 +116382,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -116529,41 +116409,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -116571,19 +116451,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 291 /* SourceFile */: - return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 290 /* SourceFile */: + return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -116666,7 +116546,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -116711,7 +116591,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -117107,55 +116987,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 197 /* CallExpression */: + case 196 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* NewExpression */: + case 197 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 158 /* Decorator */: + case 157 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -117205,22 +117085,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -117517,7 +117397,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -117686,11 +117566,11 @@ var ts; return true; } switch (declaration.kind) { - case 256 /* ImportClause */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: return true; - case 259 /* ImportSpecifier */: - return declaration.parent.kind === 258 /* NamedImports */; + case 258 /* ImportSpecifier */: + return declaration.parent.kind === 257 /* NamedImports */; default: return false; } @@ -117704,7 +117584,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -117777,9 +117657,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return true; default: return false; @@ -117897,11 +117777,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return [declaration]; - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117922,18 +117802,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return withNode(tag.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return withNode(tag.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -118102,23 +117982,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 160 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 159 /* PropertySignature */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 158 /* PropertySignature */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 247 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -118126,14 +118006,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 291 /* SourceFile */: + case 290 /* SourceFile */: return "quit"; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 210 /* BinaryExpression */: { + return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 209 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -118141,7 +118021,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -118157,14 +118037,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return rightHandSide.parameters; - case 215 /* ClassExpression */: { + case 214 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -118226,9 +118106,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -118238,7 +118118,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -118255,7 +118135,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -118462,7 +118342,7 @@ var ts; return; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -118474,21 +118354,21 @@ var ts; } } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 160 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -118500,7 +118380,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -118511,17 +118391,17 @@ var ts; } } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: + case 242 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -118536,7 +118416,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -118544,11 +118424,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -118558,9 +118438,9 @@ var ts; } endNode(); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -118568,20 +118448,20 @@ var ts; } endNode(); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 260 /* ExportAssignment */: - case 264 /* ExportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 168 /* IndexSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 248 /* TypeAliasDeclaration */: + case 259 /* ExportAssignment */: + case 263 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 167 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 247 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -118823,12 +118703,12 @@ var ts; return false; } switch (a.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -118844,7 +118724,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118874,7 +118754,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118883,16 +118763,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118904,18 +118784,18 @@ var ts; } } switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118923,13 +118803,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return "new()"; - case 166 /* CallSignature */: + case 165 /* CallSignature */: return "()"; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "[]"; default: return ""; @@ -118962,19 +118842,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 291 /* SourceFile */: - case 248 /* TypeAliasDeclaration */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 247 /* TypeAliasDeclaration */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: return true; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118984,10 +118864,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: return true; default: return false; @@ -119047,7 +118927,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -119061,13 +118941,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 155 /* ComputedPropertyName */; + return !member.name || member.name.kind === 154 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -119125,9 +119005,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: return true; default: return false; @@ -119635,7 +119515,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -119643,16 +119523,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 229 /* DoStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 281 /* CatchClause */: + case 228 /* DoStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 280 /* CatchClause */: return spanForNode(n.parent); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -119669,29 +119549,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanForNode(n.parent); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 252 /* CaseBlock */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 251 /* CaseBlock */: return spanForNode(n); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return spanForNodeArray(n.statements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return spanForJSXElement(n); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return spanForJSXFragment(n); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -119743,7 +119623,7 @@ var ts; ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -120278,10 +120158,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 131 /* DeclareKeyword */) { + if (token === 130 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 136 /* ModuleKeyword */) { + if (token === 135 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -120317,7 +120197,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -120348,7 +120228,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -120364,7 +120244,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -120394,7 +120274,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -120406,7 +120286,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -120432,7 +120312,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 140 /* RequireKeyword */) { + if (token === 139 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -120593,7 +120473,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -120805,14 +120685,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 156 /* TypeParameter */ || + kind === 155 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120919,7 +120799,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120928,14 +120808,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 269 /* JsxOpeningElement */; + || kind === 268 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 270 /* JsxClosingElement */; + || kind === 269 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -121140,10 +121020,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -121210,17 +121090,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 200 /* ParenthesizedExpression */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -121344,7 +121224,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -121691,11 +121571,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -121712,12 +121592,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -121775,9 +121655,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -121792,7 +121672,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 202 /* FunctionExpression */) { + if (node.kind === 201 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -121800,7 +121680,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 245 /* FunctionDeclaration */) { + if (node.kind === 244 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -121819,7 +121699,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121905,11 +121785,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 269 /* JsxOpeningElement */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121953,7 +121833,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121973,7 +121853,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -122029,29 +121909,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 163 /* Constructor */) { + if (functionDeclaration_1.kind === 162 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -122062,7 +121942,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -122085,7 +121965,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -122106,9 +121986,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -122127,7 +122007,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -122135,21 +122015,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 167 /* ConstructSignature */) { + if (declaration.kind === 166 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 248 /* TypeAliasDeclaration */) { + else if (declaration.kind === 247 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -122161,7 +122041,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 285 /* EnumMember */) { + if (declaration.kind === 284 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -122191,17 +122071,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -122210,13 +122090,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 254 /* ImportEqualsDeclaration */) { + if (declaration.kind === 253 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -122289,10 +122169,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -122410,16 +122290,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 202 /* FunctionExpression */) { + if (declaration.kind === 201 /* FunctionExpression */) { return true; } - if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { + if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { + if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { return false; } } @@ -122719,10 +122599,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 274 /* JsxAttribute */: - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 273 /* JsxAttribute */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122914,7 +122794,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122929,9 +122809,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -123005,7 +122885,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -123029,34 +122909,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 131 /* DeclareKeyword */, + 130 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 132 /* GetKeyword */, + 131 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 136 /* ModuleKeyword */, - 137 /* NamespaceKeyword */, + 135 /* ModuleKeyword */, + 136 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 139 /* ReadonlyKeyword */, - 143 /* SetKeyword */, + 138 /* ReadonlyKeyword */, + 142 /* SetKeyword */, 120 /* StaticKeyword */, - 146 /* TypeKeyword */, - 150 /* FromKeyword */, - 135 /* KeyOfKeyword */, - 133 /* InferKeyword */, + 145 /* TypeKeyword */, + 149 /* FromKeyword */, + 134 /* KeyOfKeyword */, + 132 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -123087,8 +122967,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 132 /* GetKeyword */, - 143 /* SetKeyword */, + 131 /* GetKeyword */, + 142 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -123099,8 +122979,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -123242,51 +123122,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 231 /* ForStatement */; + return context.contextNode.kind === 230 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 211 /* ConditionalExpression */: - case 181 /* ConditionalType */: - case 218 /* AsExpression */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 169 /* TypePredicate */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 210 /* ConditionalExpression */: + case 180 /* ConditionalType */: + case 217 /* AsExpression */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 168 /* TypePredicate */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 192 /* BindingElement */: + case 191 /* BindingElement */: // equals in type X = ... // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: // equal in p = 0 // falls through - case 157 /* Parameter */: - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 233 /* ForOfStatement */: - return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; + case 232 /* ForOfStatement */: + return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; } return false; } @@ -123298,22 +123178,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 160 /* PropertyDeclaration */ || - contextKind === 159 /* PropertySignature */ || - contextKind === 157 /* Parameter */ || - contextKind === 243 /* VariableDeclaration */ || + return contextKind === 159 /* PropertyDeclaration */ || + contextKind === 158 /* PropertySignature */ || + contextKind === 156 /* Parameter */ || + contextKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 211 /* ConditionalExpression */ || - context.contextNode.kind === 181 /* ConditionalType */; + return context.contextNode.kind === 210 /* ConditionalExpression */ || + context.contextNode.kind === 180 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 190 /* ObjectBindingPattern */ || - context.contextNode.kind === 187 /* MappedType */ || + return context.contextNode.kind === 189 /* ObjectBindingPattern */ || + context.contextNode.kind === 186 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -123339,34 +123219,34 @@ var ts; return true; } switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 194 /* ObjectLiteralExpression */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 193 /* ObjectLiteralExpression */: + case 250 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 166 /* CallSignature */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 202 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -123375,40 +123255,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; + return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 174 /* TypeLiteral */: - case 250 /* ModuleDeclaration */: - case 261 /* ExportDeclaration */: - case 262 /* NamedExports */: - case 255 /* ImportDeclaration */: - case 258 /* NamedImports */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 173 /* TypeLiteral */: + case 249 /* ModuleDeclaration */: + case 260 /* ExportDeclaration */: + case 261 /* NamedExports */: + case 254 /* ImportDeclaration */: + case 257 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 281 /* CatchClause */: - case 251 /* ModuleBlock */: - case 238 /* SwitchStatement */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 280 /* CatchClause */: + case 250 /* ModuleBlock */: + case 237 /* SwitchStatement */: return true; - case 224 /* Block */: { + case 223 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { return true; } } @@ -123417,32 +123297,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 237 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 236 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 194 /* ObjectLiteralExpression */; + return context.contextNode.kind === 193 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 197 /* CallExpression */; + return context.contextNode.kind === 196 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 198 /* NewExpression */; + return context.contextNode.kind === 197 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -123457,28 +123337,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 203 /* ArrowFunction */; + return context.contextNode.kind === 202 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 189 /* ImportType */; + return context.contextNode.kind === 188 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; + return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; + return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 274 /* JsxAttribute */; + return context.nextTokenParent.kind === 273 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 274 /* JsxAttribute */; + return context.contextNode.kind === 273 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 268 /* JsxSelfClosingElement */; + return context.contextNode.kind === 267 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -123493,45 +123373,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 250 /* ModuleDeclaration */; + return context.contextNode.kind === 249 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 167 /* ConstructSignature */; + return context.contextNode.kind === 166 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 170 /* TypeReference */: - case 200 /* TypeAssertionExpression */: - case 248 /* TypeAliasDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 199 /* TypeAssertionExpression */: + case 247 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -123542,28 +123422,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 200 /* TypeAssertionExpression */; + return context.contextNode.kind === 199 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 219 /* NonNullExpression */; + return context.contextNode.kind === 218 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 227 /* IfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; default: return false; @@ -123588,12 +123468,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 223 /* SemicolonClassElement */ || + if (nextTokenKind === 222 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || - context.contextNode.kind === 248 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || + context.contextNode.kind === 247 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -123607,9 +123487,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 231 /* ForStatement */ - && context.currentTokenParent.kind !== 225 /* EmptyStatement */ - && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 230 /* ForStatement */ + && context.currentTokenParent.kind !== 224 /* EmptyStatement */ + && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -123617,7 +123497,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 212 /* TemplateExpression */ + && nextTokenKind !== 211 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -123708,12 +123588,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 153 /* LastToken */ + 1; + var mapRowLength = 152 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123901,17 +123781,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 291 /* SourceFile */: - case 224 /* Block */: - case 251 /* ModuleBlock */: + return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 290 /* SourceFile */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -124138,19 +124018,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; - case 164 /* GetAccessor */: return 132 /* GetKeyword */; - case 165 /* SetAccessor */: return 143 /* SetKeyword */; - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; + case 163 /* GetAccessor */: return 131 /* GetKeyword */; + case 164 /* SetAccessor */: return 142 /* SetKeyword */; + case 161 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -124207,15 +124087,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 187 /* MappedType */) { + if (container.kind !== 186 /* MappedType */) { return false; } break; @@ -124318,7 +124198,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -124338,7 +124218,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -124781,12 +124661,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 202 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -124794,8 +124674,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -124803,12 +124683,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 170 /* TypeReference */: + case 169 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124926,7 +124806,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -125080,7 +124960,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -125128,7 +125008,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -125166,40 +125046,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getList(node.typeArguments); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return getList(node.properties); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getList(node.elements); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return getList(node.members); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 198 /* NewExpression */: - case 197 /* CallExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return getList(node.declarations); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return getList(node.elements); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -125222,7 +125102,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -125295,87 +125175,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 227 /* ExpressionStatement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 193 /* ArrayLiteralExpression */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 187 /* MappedType */: - case 176 /* TupleType */: - case 252 /* CaseBlock */: - case 279 /* DefaultClause */: - case 278 /* CaseClause */: - case 201 /* ParenthesizedExpression */: - case 195 /* PropertyAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 226 /* VariableStatement */: - case 260 /* ExportAssignment */: - case 236 /* ReturnStatement */: - case 211 /* ConditionalExpression */: - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: - case 268 /* JsxSelfClosingElement */: - case 277 /* JsxExpression */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 157 /* Parameter */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 183 /* ParenthesizedType */: - case 199 /* TaggedTemplateExpression */: - case 207 /* AwaitExpression */: - case 262 /* NamedExports */: - case 258 /* NamedImports */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 160 /* PropertyDeclaration */: + case 226 /* ExpressionStatement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 192 /* ArrayLiteralExpression */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 186 /* MappedType */: + case 175 /* TupleType */: + case 251 /* CaseBlock */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: + case 200 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 225 /* VariableStatement */: + case 259 /* ExportAssignment */: + case 235 /* ReturnStatement */: + case 210 /* ConditionalExpression */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: + case 267 /* JsxSelfClosingElement */: + case 276 /* JsxExpression */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 156 /* Parameter */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 182 /* ParenthesizedType */: + case 198 /* TaggedTemplateExpression */: + case 206 /* AwaitExpression */: + case 261 /* NamedExports */: + case 257 /* NamedImports */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 159 /* PropertyDeclaration */: return true; - case 243 /* VariableDeclaration */: - case 282 /* PropertyAssignment */: - case 210 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 242 /* VariableDeclaration */: + case 281 /* PropertyAssignment */: + case 209 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 210 /* BinaryExpression */) { + if (parent.kind !== 209 /* BinaryExpression */) { return true; } break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return childKind !== 224 /* Block */; - case 261 /* ExportDeclaration */: - return childKind !== 262 /* NamedExports */; - case 255 /* ImportDeclaration */: - return childKind !== 256 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); - case 267 /* JsxElement */: - return childKind !== 270 /* JsxClosingElement */; - case 271 /* JsxFragment */: - return childKind !== 273 /* JsxClosingFragment */; - case 180 /* IntersectionType */: - case 179 /* UnionType */: - if (childKind === 174 /* TypeLiteral */) { + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return childKind !== 223 /* Block */; + case 260 /* ExportDeclaration */: + return childKind !== 261 /* NamedExports */; + case 254 /* ImportDeclaration */: + return childKind !== 255 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); + case 266 /* JsxElement */: + return childKind !== 269 /* JsxClosingElement */; + case 270 /* JsxFragment */: + return childKind !== 272 /* JsxClosingFragment */; + case 179 /* IntersectionType */: + case 178 /* UnionType */: + if (childKind === 173 /* TypeLiteral */) { return false; } // falls through @@ -125386,11 +125266,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: - return parent.kind !== 224 /* Block */; + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: + return parent.kind !== 223 /* Block */; default: return false; } @@ -125532,7 +125412,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -125718,7 +125598,7 @@ var ts; } } else { - endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -125872,18 +125752,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 157 /* Parameter */: + case 156 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -125892,7 +125772,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 203 /* ArrowFunction */) { + if (node.kind === 202 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125906,14 +125786,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 224 /* Block */) { + if (node.body.kind !== 223 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -126478,14 +126358,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 157 /* Parameter */: { + case 156 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -126500,15 +126380,15 @@ var ts; } break; } - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -126516,13 +126396,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -126531,7 +126411,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -126584,13 +126464,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 281 /* CatchClause */) { + if (parent.kind === 280 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -126601,14 +126481,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -126787,8 +126667,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127019,7 +126899,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -127097,10 +126977,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || - ancestor.parent.kind === 202 /* FunctionExpression */ || - ancestor.parent.kind === 203 /* ArrowFunction */ || - ancestor.parent.kind === 162 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || + ancestor.parent.kind === 201 /* FunctionExpression */ || + ancestor.parent.kind === 202 /* ArrowFunction */ || + ancestor.parent.kind === 161 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -127219,10 +127099,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -127237,7 +127117,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -127286,9 +127166,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 160 /* PropertyDeclaration */ && + if (declaration.kind === 159 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127423,26 +127303,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 243 /* VariableDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 242 /* VariableDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 159 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -127464,7 +127344,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -127504,8 +127384,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -127539,12 +127419,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127599,7 +127479,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127607,7 +127487,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127615,12 +127495,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 203 /* ArrowFunction */: { + case 202 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 224 /* Block */) { + if (arrowFunctionBody.kind === 223 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127648,7 +127528,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -128015,8 +127895,8 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128221,10 +128101,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128277,20 +128157,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 197 /* CallExpression */: { + case 196 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128332,8 +128212,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: { + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128384,16 +128264,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return undefined; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128457,7 +128337,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128465,10 +128345,10 @@ var ts; } } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128486,7 +128366,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128499,7 +128379,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 191 /* ArrayBindingPattern */: { + case 190 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128582,11 +128462,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return parent.propertyName !== node; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129092,11 +128972,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129106,11 +128986,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return declaration.name.text; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129119,10 +128999,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 254 /* ImportEqualsDeclaration */) + if (declaration.kind === 253 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 243 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ + if (declaration.kind === 242 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129130,7 +129010,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129143,7 +129023,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { + if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129186,9 +129066,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129399,7 +129279,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 190 /* ObjectBindingPattern */) { + if (clause.kind === 189 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -130023,7 +129903,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 215 /* ClassExpression */) { + if (classDeclaration.kind === 214 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130071,7 +129951,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 210 /* BinaryExpression */) { + if (token.parent.parent.kind === 209 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130117,7 +129997,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130141,7 +130021,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130704,7 +130584,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +130616,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 133 /* InferKeyword */) + if (token.kind === 132 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +130635,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +130646,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +130662,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 157 /* Parameter */) { + if (decl.kind === 156 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +130673,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +130682,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +130691,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 157 /* Parameter */: - case 156 /* TypeParameter */: + case 156 /* Parameter */: + case 155 /* TypeParameter */: return true; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return true; } } @@ -130865,17 +130745,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: return true; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +130764,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +130813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +130824,8 @@ var ts; return; } // falls through - case 230 /* WhileStatement */: - case 231 /* ForStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +130898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 298 /* JSDocNullableType */) { + if (typeNode.kind === 297 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +130918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +130935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 218 /* AsExpression */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 245 /* FunctionDeclaration */: - case 164 /* GetAccessor */: - case 168 /* IndexSignature */: - case 187 /* MappedType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 200 /* TypeAssertionExpression */: - case 243 /* VariableDeclaration */: + case 217 /* AsExpression */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 163 /* GetAccessor */: + case 167 /* IndexSignature */: + case 186 /* MappedType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 199 /* TypeAssertionExpression */: + case 242 /* VariableDeclaration */: return true; default: return false; @@ -131172,14 +131052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131452,7 +131332,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -131501,14 +131381,14 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 160 /* PropertyDeclaration */) { + if (signature.parent.kind === 159 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -131518,14 +131398,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 318 /* JSDocParameterTag */: { + case 317 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -131550,18 +131430,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 163 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); + case 162 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -131703,24 +131583,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -131728,20 +131608,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -131860,7 +131740,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -131888,7 +131768,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 197 /* CallExpression */) { + if (parent.kind === 196 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -132104,9 +131984,6 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } - else if (genericType.flags & 134217728 /* Awaited */) { - return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); - } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -132123,7 +132000,6 @@ var ts; } var genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */); var usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */); - // allow for multiple overloads of `then`. if (genericSigs.length === 1 && usageSigs.length === 1) { return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); } @@ -132282,8 +132158,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -132297,8 +132173,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: { + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -132327,8 +132203,8 @@ var ts; } break; } - case 161 /* MethodSignature */: - case 162 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 161 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -132373,7 +132249,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -132635,7 +132511,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -132754,7 +132630,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -132930,7 +132806,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -132982,7 +132858,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -133183,16 +133059,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: { + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -133220,12 +133096,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -133233,9 +133109,9 @@ var ts; break; } // falls through - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -133262,18 +133138,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: { + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 256 /* ImportClause */: { + case 255 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -133282,7 +133158,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 257 /* NamespaceImport */) { + else if (namedBindings.kind === 256 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -133303,11 +133179,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 259 /* ImportSpecifier */: { + case 258 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -133320,7 +133196,7 @@ var ts; } break; } - case 264 /* ExportSpecifier */: { + case 263 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -133353,8 +133229,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -133376,7 +133252,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 257 /* NamespaceImport */) { + if (toConvert.kind === 256 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -133723,20 +133599,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 160 /* PropertyDeclaration */) { + if (current.kind === 159 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 157 /* Parameter */) { + else if (current.kind === 156 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 163 /* Constructor */) { + if (ctorOrMethod.kind === 162 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 162 /* MethodDeclaration */) { + else if (current.kind === 161 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -133779,7 +133655,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -133791,13 +133667,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 197 /* CallExpression */) { + if (node.parent.kind === 196 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -133812,8 +133688,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -133825,21 +133701,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 224 /* Block */: - if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { + case 223 /* Block */: + if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 279 /* DefaultClause */: - case 278 /* CaseClause */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -133851,19 +133727,19 @@ var ts; break; } switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: { + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -133872,20 +133748,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -133939,7 +133815,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 157 /* Parameter */) { + if (current.kind === 156 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -133950,7 +133826,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 291 /* SourceFile */) { + if (current.kind === 290 /* SourceFile */) { return scopes; } } @@ -134040,32 +133916,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return "arrow function"; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 246 /* ClassDeclaration */ + return scope.kind === 245 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 251 /* ModuleBlock */ + return scope.kind === 250 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -134285,9 +134161,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } } /** @@ -134316,7 +134192,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -134345,7 +134221,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -134364,7 +134240,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -134508,7 +134384,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -134686,7 +134562,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -135002,30 +134878,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 285 /* EnumMember */: + case 284 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 255 /* ImportDeclaration */ && - parent.kind !== 259 /* ImportSpecifier */; - case 214 /* SpreadElement */: - case 190 /* ObjectBindingPattern */: - case 192 /* BindingElement */: + return parent.kind !== 254 /* ImportDeclaration */ && + parent.kind !== 258 /* ImportSpecifier */; + case 213 /* SpreadElement */: + case 189 /* ObjectBindingPattern */: + case 191 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 192 /* BindingElement */ && - parent.kind !== 259 /* ImportSpecifier */ && - parent.kind !== 264 /* ExportSpecifier */; + return parent.kind !== 191 /* BindingElement */ && + parent.kind !== 258 /* ImportSpecifier */ && + parent.kind !== 263 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 224 /* Block */: - case 291 /* SourceFile */: - case 251 /* ModuleBlock */: - case 278 /* CaseClause */: + case 223 /* Block */: + case 290 /* SourceFile */: + case 250 /* ModuleBlock */: + case 277 /* CaseClause */: return true; default: return false; @@ -135189,7 +135065,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(323 /* JSDocTypedefTag */); + var node = ts.createNode(322 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -135197,10 +135073,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(322 /* JSDocTemplateTag */); + var template = ts.createNode(321 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(156 /* TypeParameter */); + var parameter = ts.createNode(155 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -135311,7 +135187,7 @@ var ts; isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -135454,11 +135330,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return true; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -135546,12 +135422,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? + case 254 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -135582,20 +135458,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -135665,15 +135541,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -135686,7 +135562,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -135698,7 +135574,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 258 /* NamedImports */) { + else if (namedBindings.kind === 257 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -135716,9 +135592,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -135845,13 +135721,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: return true; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -135863,7 +135739,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -135873,9 +135749,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -135884,7 +135760,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -135896,9 +135772,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return name; - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -135955,13 +135831,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -135969,17 +135845,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return cb(statement); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -135991,8 +135867,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -136003,9 +135879,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return d.parent.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -136038,23 +135914,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -136065,18 +135941,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -136346,15 +136222,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -136364,7 +136240,7 @@ var ts; } break; // x["foo"](...) - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -136383,14 +136259,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -136432,11 +136308,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 163 /* Constructor */: + case 162 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -136444,8 +136320,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -136616,7 +136492,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -136624,7 +136500,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -136635,25 +136511,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return [functionDeclaration.name]; - case 163 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { + case 162 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -136904,8 +136780,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); - return child.kind < 154 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); + return child.kind < 153 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -136916,7 +136792,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -136974,7 +136850,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -137288,7 +137164,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 291 /* SourceFile */; + _this.kind = 290 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -137347,10 +137223,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -137370,31 +137246,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 173 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: { + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -137405,12 +137281,12 @@ var ts; } } // falls through - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: addDeclaration(node); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -137423,7 +137299,7 @@ var ts; } } break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -137435,7 +137311,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -137444,7 +137320,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -138063,12 +137939,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -138170,15 +138046,15 @@ var ts; return undefined; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -138195,7 +138071,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -138672,7 +138548,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 266 /* ExternalModuleReference */ || + node.parent.kind === 265 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -138690,13 +138566,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 155 /* ComputedPropertyName */) { + if (node.parent.kind === 154 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && + (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -138738,7 +138614,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 196 /* ElementAccessExpression */ && + node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -138818,114 +138694,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return spanInVariableDeclaration(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return spanInParameterDeclaration(node); - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanInBlock(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInBlock(node.block); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return spanInForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 192 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 191 /* BindingElement */: // span on complete node return textSpan(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 158 /* Decorator */: + case 157 /* Decorator */: return spanInNodeArray(parent.decorators); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -138955,7 +138831,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 153 /* OfKeyword */: + case 152 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -138968,13 +138844,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 214 /* SpreadElement */ || - node.kind === 282 /* PropertyAssignment */ || - node.kind === 283 /* ShorthandPropertyAssignment */) && + node.kind === 213 /* SpreadElement */ || + node.kind === 281 /* PropertyAssignment */ || + node.kind === 282 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -138996,22 +138872,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 158 /* Decorator */: + case 157 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return textSpan(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -139020,21 +138896,21 @@ var ts; } } switch (node.parent.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: { + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -139042,7 +138918,7 @@ var ts; } break; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -139072,7 +138948,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -139084,7 +138960,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 233 /* ForOfStatement */) { + parent.parent.kind === 232 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -139125,7 +139001,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); + (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -139148,26 +139024,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 232 /* ForInStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 231 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -139192,21 +139068,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 192 /* BindingElement */) { + if (bindingPattern.parent.kind === 191 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); - var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); + var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -139214,18 +139090,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -139233,25 +139109,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 249 /* EnumDeclaration */: - case 246 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -139259,7 +139135,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139275,7 +139151,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139290,12 +139166,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 197 /* CallExpression */ || - node.parent.kind === 198 /* NewExpression */) { + if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 196 /* CallExpression */ || + node.parent.kind === 197 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 201 /* ParenthesizedExpression */) { + if (node.parent.kind === 200 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -139304,21 +139180,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 201 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 200 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -139328,20 +139204,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ || - node.parent.kind === 157 /* Parameter */) { + node.parent.kind === 281 /* PropertyAssignment */ || + node.parent.kind === 156 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 200 /* TypeAssertionExpression */) { + if (node.parent.kind === 199 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 229 /* DoStatement */) { + if (node.parent.kind === 228 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -139349,7 +139225,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.kind === 232 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index d5b00fa19de..b73d5410bce 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,211 +203,210 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - AwaitedKeyword = 128, - BooleanKeyword = 129, - ConstructorKeyword = 130, - DeclareKeyword = 131, - GetKeyword = 132, - InferKeyword = 133, - IsKeyword = 134, - KeyOfKeyword = 135, - ModuleKeyword = 136, - NamespaceKeyword = 137, - NeverKeyword = 138, - ReadonlyKeyword = 139, - RequireKeyword = 140, - NumberKeyword = 141, - ObjectKeyword = 142, - SetKeyword = 143, - StringKeyword = 144, - SymbolKeyword = 145, - TypeKeyword = 146, - UndefinedKeyword = 147, - UniqueKeyword = 148, - UnknownKeyword = 149, - FromKeyword = 150, - GlobalKeyword = 151, - BigIntKeyword = 152, - OfKeyword = 153, - QualifiedName = 154, - ComputedPropertyName = 155, - TypeParameter = 156, - Parameter = 157, - Decorator = 158, - PropertySignature = 159, - PropertyDeclaration = 160, - MethodSignature = 161, - MethodDeclaration = 162, - Constructor = 163, - GetAccessor = 164, - SetAccessor = 165, - CallSignature = 166, - ConstructSignature = 167, - IndexSignature = 168, - TypePredicate = 169, - TypeReference = 170, - FunctionType = 171, - ConstructorType = 172, - TypeQuery = 173, - TypeLiteral = 174, - ArrayType = 175, - TupleType = 176, - OptionalType = 177, - RestType = 178, - UnionType = 179, - IntersectionType = 180, - ConditionalType = 181, - InferType = 182, - ParenthesizedType = 183, - ThisType = 184, - TypeOperator = 185, - IndexedAccessType = 186, - MappedType = 187, - LiteralType = 188, - ImportType = 189, - ObjectBindingPattern = 190, - ArrayBindingPattern = 191, - BindingElement = 192, - ArrayLiteralExpression = 193, - ObjectLiteralExpression = 194, - PropertyAccessExpression = 195, - ElementAccessExpression = 196, - CallExpression = 197, - NewExpression = 198, - TaggedTemplateExpression = 199, - TypeAssertionExpression = 200, - ParenthesizedExpression = 201, - FunctionExpression = 202, - ArrowFunction = 203, - DeleteExpression = 204, - TypeOfExpression = 205, - VoidExpression = 206, - AwaitExpression = 207, - PrefixUnaryExpression = 208, - PostfixUnaryExpression = 209, - BinaryExpression = 210, - ConditionalExpression = 211, - TemplateExpression = 212, - YieldExpression = 213, - SpreadElement = 214, - ClassExpression = 215, - OmittedExpression = 216, - ExpressionWithTypeArguments = 217, - AsExpression = 218, - NonNullExpression = 219, - MetaProperty = 220, - SyntheticExpression = 221, - TemplateSpan = 222, - SemicolonClassElement = 223, - Block = 224, - EmptyStatement = 225, - VariableStatement = 226, - ExpressionStatement = 227, - IfStatement = 228, - DoStatement = 229, - WhileStatement = 230, - ForStatement = 231, - ForInStatement = 232, - ForOfStatement = 233, - ContinueStatement = 234, - BreakStatement = 235, - ReturnStatement = 236, - WithStatement = 237, - SwitchStatement = 238, - LabeledStatement = 239, - ThrowStatement = 240, - TryStatement = 241, - DebuggerStatement = 242, - VariableDeclaration = 243, - VariableDeclarationList = 244, - FunctionDeclaration = 245, - ClassDeclaration = 246, - InterfaceDeclaration = 247, - TypeAliasDeclaration = 248, - EnumDeclaration = 249, - ModuleDeclaration = 250, - ModuleBlock = 251, - CaseBlock = 252, - NamespaceExportDeclaration = 253, - ImportEqualsDeclaration = 254, - ImportDeclaration = 255, - ImportClause = 256, - NamespaceImport = 257, - NamedImports = 258, - ImportSpecifier = 259, - ExportAssignment = 260, - ExportDeclaration = 261, - NamedExports = 262, - NamespaceExport = 263, - ExportSpecifier = 264, - MissingDeclaration = 265, - ExternalModuleReference = 266, - JsxElement = 267, - JsxSelfClosingElement = 268, - JsxOpeningElement = 269, - JsxClosingElement = 270, - JsxFragment = 271, - JsxOpeningFragment = 272, - JsxClosingFragment = 273, - JsxAttribute = 274, - JsxAttributes = 275, - JsxSpreadAttribute = 276, - JsxExpression = 277, - CaseClause = 278, - DefaultClause = 279, - HeritageClause = 280, - CatchClause = 281, - PropertyAssignment = 282, - ShorthandPropertyAssignment = 283, - SpreadAssignment = 284, - EnumMember = 285, - UnparsedPrologue = 286, - UnparsedPrepend = 287, - UnparsedText = 288, - UnparsedInternalText = 289, - UnparsedSyntheticReference = 290, - SourceFile = 291, - Bundle = 292, - UnparsedSource = 293, - InputFiles = 294, - JSDocTypeExpression = 295, - JSDocAllType = 296, - JSDocUnknownType = 297, - JSDocNullableType = 298, - JSDocNonNullableType = 299, - JSDocOptionalType = 300, - JSDocFunctionType = 301, - JSDocVariadicType = 302, - JSDocNamepathType = 303, - JSDocComment = 304, - JSDocTypeLiteral = 305, - JSDocSignature = 306, - JSDocTag = 307, - JSDocAugmentsTag = 308, - JSDocImplementsTag = 309, - JSDocAuthorTag = 310, - JSDocClassTag = 311, - JSDocPublicTag = 312, - JSDocPrivateTag = 313, - JSDocProtectedTag = 314, - JSDocReadonlyTag = 315, - JSDocCallbackTag = 316, - JSDocEnumTag = 317, - JSDocParameterTag = 318, - JSDocReturnTag = 319, - JSDocThisTag = 320, - JSDocTypeTag = 321, - JSDocTemplateTag = 322, - JSDocTypedefTag = 323, - JSDocPropertyTag = 324, - SyntaxList = 325, - NotEmittedStatement = 326, - PartiallyEmittedExpression = 327, - CommaListExpression = 328, - MergeDeclarationMarker = 329, - EndOfDeclarationMarker = 330, - SyntheticReferenceExpression = 331, - Count = 332, + BooleanKeyword = 128, + ConstructorKeyword = 129, + DeclareKeyword = 130, + GetKeyword = 131, + InferKeyword = 132, + IsKeyword = 133, + KeyOfKeyword = 134, + ModuleKeyword = 135, + NamespaceKeyword = 136, + NeverKeyword = 137, + ReadonlyKeyword = 138, + RequireKeyword = 139, + NumberKeyword = 140, + ObjectKeyword = 141, + SetKeyword = 142, + StringKeyword = 143, + SymbolKeyword = 144, + TypeKeyword = 145, + UndefinedKeyword = 146, + UniqueKeyword = 147, + UnknownKeyword = 148, + FromKeyword = 149, + GlobalKeyword = 150, + BigIntKeyword = 151, + OfKeyword = 152, + QualifiedName = 153, + ComputedPropertyName = 154, + TypeParameter = 155, + Parameter = 156, + Decorator = 157, + PropertySignature = 158, + PropertyDeclaration = 159, + MethodSignature = 160, + MethodDeclaration = 161, + Constructor = 162, + GetAccessor = 163, + SetAccessor = 164, + CallSignature = 165, + ConstructSignature = 166, + IndexSignature = 167, + TypePredicate = 168, + TypeReference = 169, + FunctionType = 170, + ConstructorType = 171, + TypeQuery = 172, + TypeLiteral = 173, + ArrayType = 174, + TupleType = 175, + OptionalType = 176, + RestType = 177, + UnionType = 178, + IntersectionType = 179, + ConditionalType = 180, + InferType = 181, + ParenthesizedType = 182, + ThisType = 183, + TypeOperator = 184, + IndexedAccessType = 185, + MappedType = 186, + LiteralType = 187, + ImportType = 188, + ObjectBindingPattern = 189, + ArrayBindingPattern = 190, + BindingElement = 191, + ArrayLiteralExpression = 192, + ObjectLiteralExpression = 193, + PropertyAccessExpression = 194, + ElementAccessExpression = 195, + CallExpression = 196, + NewExpression = 197, + TaggedTemplateExpression = 198, + TypeAssertionExpression = 199, + ParenthesizedExpression = 200, + FunctionExpression = 201, + ArrowFunction = 202, + DeleteExpression = 203, + TypeOfExpression = 204, + VoidExpression = 205, + AwaitExpression = 206, + PrefixUnaryExpression = 207, + PostfixUnaryExpression = 208, + BinaryExpression = 209, + ConditionalExpression = 210, + TemplateExpression = 211, + YieldExpression = 212, + SpreadElement = 213, + ClassExpression = 214, + OmittedExpression = 215, + ExpressionWithTypeArguments = 216, + AsExpression = 217, + NonNullExpression = 218, + MetaProperty = 219, + SyntheticExpression = 220, + TemplateSpan = 221, + SemicolonClassElement = 222, + Block = 223, + EmptyStatement = 224, + VariableStatement = 225, + ExpressionStatement = 226, + IfStatement = 227, + DoStatement = 228, + WhileStatement = 229, + ForStatement = 230, + ForInStatement = 231, + ForOfStatement = 232, + ContinueStatement = 233, + BreakStatement = 234, + ReturnStatement = 235, + WithStatement = 236, + SwitchStatement = 237, + LabeledStatement = 238, + ThrowStatement = 239, + TryStatement = 240, + DebuggerStatement = 241, + VariableDeclaration = 242, + VariableDeclarationList = 243, + FunctionDeclaration = 244, + ClassDeclaration = 245, + InterfaceDeclaration = 246, + TypeAliasDeclaration = 247, + EnumDeclaration = 248, + ModuleDeclaration = 249, + ModuleBlock = 250, + CaseBlock = 251, + NamespaceExportDeclaration = 252, + ImportEqualsDeclaration = 253, + ImportDeclaration = 254, + ImportClause = 255, + NamespaceImport = 256, + NamedImports = 257, + ImportSpecifier = 258, + ExportAssignment = 259, + ExportDeclaration = 260, + NamedExports = 261, + NamespaceExport = 262, + ExportSpecifier = 263, + MissingDeclaration = 264, + ExternalModuleReference = 265, + JsxElement = 266, + JsxSelfClosingElement = 267, + JsxOpeningElement = 268, + JsxClosingElement = 269, + JsxFragment = 270, + JsxOpeningFragment = 271, + JsxClosingFragment = 272, + JsxAttribute = 273, + JsxAttributes = 274, + JsxSpreadAttribute = 275, + JsxExpression = 276, + CaseClause = 277, + DefaultClause = 278, + HeritageClause = 279, + CatchClause = 280, + PropertyAssignment = 281, + ShorthandPropertyAssignment = 282, + SpreadAssignment = 283, + EnumMember = 284, + UnparsedPrologue = 285, + UnparsedPrepend = 286, + UnparsedText = 287, + UnparsedInternalText = 288, + UnparsedSyntheticReference = 289, + SourceFile = 290, + Bundle = 291, + UnparsedSource = 292, + InputFiles = 293, + JSDocTypeExpression = 294, + JSDocAllType = 295, + JSDocUnknownType = 296, + JSDocNullableType = 297, + JSDocNonNullableType = 298, + JSDocOptionalType = 299, + JSDocFunctionType = 300, + JSDocVariadicType = 301, + JSDocNamepathType = 302, + JSDocComment = 303, + JSDocTypeLiteral = 304, + JSDocSignature = 305, + JSDocTag = 306, + JSDocAugmentsTag = 307, + JSDocImplementsTag = 308, + JSDocAuthorTag = 309, + JSDocClassTag = 310, + JSDocPublicTag = 311, + JSDocPrivateTag = 312, + JSDocProtectedTag = 313, + JSDocReadonlyTag = 314, + JSDocCallbackTag = 315, + JSDocEnumTag = 316, + JSDocParameterTag = 317, + JSDocReturnTag = 318, + JSDocThisTag = 319, + JSDocTypeTag = 320, + JSDocTemplateTag = 321, + JSDocTypedefTag = 322, + JSDocPropertyTag = 323, + SyntaxList = 324, + NotEmittedStatement = 325, + PartiallyEmittedExpression = 326, + CommaListExpression = 327, + MergeDeclarationMarker = 328, + EndOfDeclarationMarker = 329, + SyntheticReferenceExpression = 330, + Count = 331, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -415,15 +414,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 153, + LastKeyword = 152, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 169, - LastTypeNode = 189, + FirstTypeNode = 168, + LastTypeNode = 188, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 153, + LastToken = 152, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -432,13 +431,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 226, - LastStatement = 242, - FirstNode = 154, - FirstJSDocNode = 295, - LastJSDocNode = 324, - FirstJSDocTagNode = 307, - LastJSDocTagNode = 324, + FirstStatement = 225, + LastStatement = 241, + FirstNode = 153, + FirstJSDocNode = 294, + LastJSDocNode = 323, + FirstJSDocTagNode = 306, + LastJSDocTagNode = 323, } export enum NodeFlags { None = 0, @@ -845,7 +844,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1138,7 +1137,7 @@ declare namespace ts { export interface CallChain extends CallExpression { _optionalChainBrand: any; } - export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain; + export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; export interface SuperCall extends CallExpression { expression: SuperExpression; } @@ -1178,6 +1177,9 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + export interface NonNullChain extends NonNullExpression { + _optionalChainBrand: any; + } export interface MetaProperty extends PrimaryExpression { kind: SyntaxKind.MetaProperty; keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; @@ -2361,7 +2363,6 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2376,11 +2377,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 193200128, + InstantiableNonPrimitive = 58982400, InstantiablePrimitive = 4194304, - Instantiable = 197394432, - StructuredOrInstantiable = 201064448, - Narrowable = 268188671, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2528,9 +2529,6 @@ declare namespace ts { baseType: Type; substitute: Type; } - export interface AwaitedType extends InstantiableType { - awaitedType: Type; - } export enum SignatureKind { Call = 0, Construct = 1 @@ -3634,7 +3632,7 @@ declare namespace ts { function isElementAccessChain(node: Node): node is ElementAccessChain; function isCallExpression(node: Node): node is CallExpression; function isCallChain(node: Node): node is CallChain; - function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain; + function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; function isNullishCoalesce(node: Node): boolean; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; @@ -3661,6 +3659,7 @@ declare namespace ts { function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; function isAsExpression(node: Node): node is AsExpression; function isNonNullExpression(node: Node): node is NonNullExpression; + function isNonNullChain(node: Node): node is NonNullChain; function isMetaProperty(node: Node): node is MetaProperty; function isTemplateSpan(node: Node): node is TemplateSpan; function isSemicolonClassElement(node: Node): node is SemicolonClassElement; @@ -4071,7 +4070,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4152,6 +4151,8 @@ declare namespace ts { function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; function createNonNullExpression(expression: Expression): NonNullExpression; function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createNonNullChain(expression: Expression): NonNullChain; + function updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; function createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; function updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; diff --git a/lib/typescript.js b/lib/typescript.js index 53f59f11cad..980d42797af 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -3203,234 +3203,233 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3439,15 +3438,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3456,15 +3455,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4010,7 +4009,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4039,10 +4037,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4051,10 +4049,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -8208,8 +8206,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 152 /* BigIntKeyword */, - boolean: 129 /* BooleanKeyword */, + bigint: 151 /* BigIntKeyword */, + boolean: 128 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8217,9 +8215,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 130 /* ConstructorKeyword */, + _a["" + "constructor"] = 129 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 131 /* DeclareKeyword */, + _a.declare = 130 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8230,49 +8228,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 150 /* FromKeyword */, + _a.from = 149 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 132 /* GetKeyword */, + _a.get = 131 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 133 /* InferKeyword */, + _a.infer = 132 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 134 /* IsKeyword */, - _a.keyof = 135 /* KeyOfKeyword */, + _a.is = 133 /* IsKeyword */, + _a.keyof = 134 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 136 /* ModuleKeyword */, - _a.namespace = 137 /* NamespaceKeyword */, - _a.never = 138 /* NeverKeyword */, + _a.module = 135 /* ModuleKeyword */, + _a.namespace = 136 /* NamespaceKeyword */, + _a.never = 137 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 141 /* NumberKeyword */, - _a.object = 142 /* ObjectKeyword */, + _a.number = 140 /* NumberKeyword */, + _a.object = 141 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 139 /* ReadonlyKeyword */, - _a.require = 140 /* RequireKeyword */, - _a.global = 151 /* GlobalKeyword */, + _a.readonly = 138 /* ReadonlyKeyword */, + _a.require = 139 /* RequireKeyword */, + _a.global = 150 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 143 /* SetKeyword */, + _a.set = 142 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 144 /* StringKeyword */, + _a.string = 143 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 145 /* SymbolKeyword */, + _a.symbol = 144 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 146 /* TypeKeyword */, + _a.type = 145 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 147 /* UndefinedKeyword */, - _a.unique = 148 /* UniqueKeyword */, - _a.unknown = 149 /* UnknownKeyword */, + _a.undefined = 146 /* UndefinedKeyword */, + _a.unique = 147 /* UniqueKeyword */, + _a.unknown = 148 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8280,8 +8278,7 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.awaited = 128 /* AwaitedKeyword */, - _a.of = 153 /* OfKeyword */, + _a.of = 152 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -10635,9 +10632,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156 /* TypeParameter */) { + if (d && d.kind === 155 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { return current; } } @@ -10645,7 +10642,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10675,14 +10672,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243 /* VariableDeclaration */) { + if (node.kind === 242 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 244 /* VariableDeclarationList */) { + if (node && node.kind === 243 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226 /* VariableStatement */) { + if (node && node.kind === 225 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10831,30 +10828,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return expr.name; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10891,16 +10888,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: { + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 154 /* QualifiedName */) { + if (name.kind === 153 /* QualifiedName */) { return name.right; } break; } - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10916,15 +10913,15 @@ var ts; return undefined; } } - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 317 /* JSDocEnumTag */: + case 316 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11160,7 +11157,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11231,11 +11228,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 154 /* QualifiedName */; + return node.kind === 153 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155 /* ComputedPropertyName */; + return node.kind === 154 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11248,164 +11245,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 156 /* TypeParameter */; + return node.kind === 155 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157 /* Parameter */; + return node.kind === 156 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 159 /* PropertySignature */; + return node.kind === 158 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160 /* PropertyDeclaration */; + return node.kind === 159 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161 /* MethodSignature */; + return node.kind === 160 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163 /* Constructor */; + return node.kind === 162 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166 /* CallSignature */; + return node.kind === 165 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167 /* ConstructSignature */; + return node.kind === 166 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168 /* IndexSignature */; + return node.kind === 167 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; + return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 169 /* TypePredicate */; + return node.kind === 168 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170 /* TypeReference */; + return node.kind === 169 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171 /* FunctionType */; + return node.kind === 170 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172 /* ConstructorType */; + return node.kind === 171 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174 /* TypeLiteral */; + return node.kind === 173 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175 /* ArrayType */; + return node.kind === 174 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176 /* TupleType */; + return node.kind === 175 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179 /* UnionType */; + return node.kind === 178 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180 /* IntersectionType */; + return node.kind === 179 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181 /* ConditionalType */; + return node.kind === 180 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182 /* InferType */; + return node.kind === 181 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183 /* ParenthesizedType */; + return node.kind === 182 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184 /* ThisType */; + return node.kind === 183 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185 /* TypeOperator */; + return node.kind === 184 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186 /* IndexedAccessType */; + return node.kind === 185 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187 /* MappedType */; + return node.kind === 186 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188 /* LiteralType */; + return node.kind === 187 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189 /* ImportType */; + return node.kind === 188 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 190 /* ObjectBindingPattern */; + return node.kind === 189 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191 /* ArrayBindingPattern */; + return node.kind === 190 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192 /* BindingElement */; + return node.kind === 191 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 193 /* ArrayLiteralExpression */; + return node.kind === 192 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194 /* ObjectLiteralExpression */; + return node.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11413,7 +11410,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196 /* ElementAccessExpression */; + return node.kind === 195 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11421,7 +11418,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197 /* CallExpression */; + return node.kind === 196 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11431,14 +11428,15 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 195 /* PropertyAccessExpression */ - || kind === 196 /* ElementAccessExpression */ - || kind === 197 /* CallExpression */); + (kind === 194 /* PropertyAccessExpression */ + || kind === 195 /* ElementAccessExpression */ + || kind === 196 /* CallExpression */ + || kind === 218 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; /** @@ -11453,33 +11451,34 @@ var ts; * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`: * * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`) - * 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) - * 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is + * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`) + * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) + * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is * the end of the chain starting at `c?.`) - * 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is + * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is * the end of the chain starting at `a?.`) */ /* @internal */ function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) // cases 1 and 2 - || isOptionalChainRoot(node.parent) // case 3 - || node !== node.parent.expression; // case 4 + return !isOptionalChain(node.parent) // cases 1, 2, and 3 + || isOptionalChainRoot(node.parent) // case 4 + || node !== node.parent.expression; // case 5 } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198 /* NewExpression */; + return node.kind === 197 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199 /* TaggedTemplateExpression */; + return node.kind === 198 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200 /* TypeAssertionExpression */; + return node.kind === 199 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11488,384 +11487,385 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201 /* ParenthesizedExpression */; + return node.kind === 200 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202 /* FunctionExpression */; + return node.kind === 201 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203 /* ArrowFunction */; + return node.kind === 202 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204 /* DeleteExpression */; + return node.kind === 203 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205 /* TypeOfExpression */; + return node.kind === 204 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206 /* VoidExpression */; + return node.kind === 205 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207 /* AwaitExpression */; + return node.kind === 206 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208 /* PrefixUnaryExpression */; + return node.kind === 207 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209 /* PostfixUnaryExpression */; + return node.kind === 208 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210 /* BinaryExpression */; + return node.kind === 209 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211 /* ConditionalExpression */; + return node.kind === 210 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212 /* TemplateExpression */; + return node.kind === 211 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213 /* YieldExpression */; + return node.kind === 212 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214 /* SpreadElement */; + return node.kind === 213 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215 /* ClassExpression */; + return node.kind === 214 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216 /* OmittedExpression */; + return node.kind === 215 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218 /* AsExpression */; + return node.kind === 217 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219 /* NonNullExpression */; + return node.kind === 218 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220 /* MetaProperty */; + return node.kind === 219 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 222 /* TemplateSpan */; + return node.kind === 221 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223 /* SemicolonClassElement */; + return node.kind === 222 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 224 /* Block */; + return node.kind === 223 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226 /* VariableStatement */; + return node.kind === 225 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225 /* EmptyStatement */; + return node.kind === 224 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227 /* ExpressionStatement */; + return node.kind === 226 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228 /* IfStatement */; + return node.kind === 227 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229 /* DoStatement */; + return node.kind === 228 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230 /* WhileStatement */; + return node.kind === 229 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231 /* ForStatement */; + return node.kind === 230 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232 /* ForInStatement */; + return node.kind === 231 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233 /* ForOfStatement */; + return node.kind === 232 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234 /* ContinueStatement */; + return node.kind === 233 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235 /* BreakStatement */; + return node.kind === 234 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; + return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236 /* ReturnStatement */; + return node.kind === 235 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237 /* WithStatement */; + return node.kind === 236 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238 /* SwitchStatement */; + return node.kind === 237 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239 /* LabeledStatement */; + return node.kind === 238 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240 /* ThrowStatement */; + return node.kind === 239 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241 /* TryStatement */; + return node.kind === 240 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242 /* DebuggerStatement */; + return node.kind === 241 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243 /* VariableDeclaration */; + return node.kind === 242 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244 /* VariableDeclarationList */; + return node.kind === 243 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245 /* FunctionDeclaration */; + return node.kind === 244 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246 /* ClassDeclaration */; + return node.kind === 245 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247 /* InterfaceDeclaration */; + return node.kind === 246 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248 /* TypeAliasDeclaration */; + return node.kind === 247 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249 /* EnumDeclaration */; + return node.kind === 248 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */; + return node.kind === 249 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251 /* ModuleBlock */; + return node.kind === 250 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252 /* CaseBlock */; + return node.kind === 251 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253 /* NamespaceExportDeclaration */; + return node.kind === 252 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */; + return node.kind === 253 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255 /* ImportDeclaration */; + return node.kind === 254 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256 /* ImportClause */; + return node.kind === 255 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257 /* NamespaceImport */; + return node.kind === 256 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263 /* NamespaceExport */; + return node.kind === 262 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; + return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258 /* NamedImports */; + return node.kind === 257 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259 /* ImportSpecifier */; + return node.kind === 258 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260 /* ExportAssignment */; + return node.kind === 259 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261 /* ExportDeclaration */; + return node.kind === 260 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262 /* NamedExports */; + return node.kind === 261 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264 /* ExportSpecifier */; + return node.kind === 263 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265 /* MissingDeclaration */; + return node.kind === 264 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 266 /* ExternalModuleReference */; + return node.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 267 /* JsxElement */; + return node.kind === 266 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268 /* JsxSelfClosingElement */; + return node.kind === 267 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269 /* JsxOpeningElement */; + return node.kind === 268 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270 /* JsxClosingElement */; + return node.kind === 269 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271 /* JsxFragment */; + return node.kind === 270 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272 /* JsxOpeningFragment */; + return node.kind === 271 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273 /* JsxClosingFragment */; + return node.kind === 272 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274 /* JsxAttribute */; + return node.kind === 273 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275 /* JsxAttributes */; + return node.kind === 274 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276 /* JsxSpreadAttribute */; + return node.kind === 275 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277 /* JsxExpression */; + return node.kind === 276 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 278 /* CaseClause */; + return node.kind === 277 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279 /* DefaultClause */; + return node.kind === 278 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280 /* HeritageClause */; + return node.kind === 279 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281 /* CatchClause */; + return node.kind === 280 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 282 /* PropertyAssignment */; + return node.kind === 281 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */; + return node.kind === 282 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284 /* SpreadAssignment */; + return node.kind === 283 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 291 /* SourceFile */; + return node.kind === 290 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292 /* Bundle */; + return node.kind === 291 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293 /* UnparsedSource */; + return node.kind === 292 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287 /* UnparsedPrepend */; + return node.kind === 286 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return true; default: return false; @@ -11874,125 +11874,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 /* UnparsedPrologue */ || - node.kind === 290 /* UnparsedSyntheticReference */; + node.kind === 285 /* UnparsedPrologue */ || + node.kind === 289 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 295 /* JSDocTypeExpression */; + return node.kind === 294 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296 /* JSDocAllType */; + return node.kind === 295 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297 /* JSDocUnknownType */; + return node.kind === 296 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298 /* JSDocNullableType */; + return node.kind === 297 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299 /* JSDocNonNullableType */; + return node.kind === 298 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300 /* JSDocOptionalType */; + return node.kind === 299 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301 /* JSDocFunctionType */; + return node.kind === 300 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302 /* JSDocVariadicType */; + return node.kind === 301 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304 /* JSDocComment */; + return node.kind === 303 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310 /* JSDocAuthorTag */; + return node.kind === 309 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308 /* JSDocAugmentsTag */; + return node.kind === 307 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309 /* JSDocImplementsTag */; + return node.kind === 308 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311 /* JSDocClassTag */; + return node.kind === 310 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312 /* JSDocPublicTag */; + return node.kind === 311 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313 /* JSDocPrivateTag */; + return node.kind === 312 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314 /* JSDocProtectedTag */; + return node.kind === 313 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315 /* JSDocReadonlyTag */; + return node.kind === 314 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317 /* JSDocEnumTag */; + return node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320 /* JSDocThisTag */; + return node.kind === 319 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318 /* JSDocParameterTag */; + return node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319 /* JSDocReturnTag */; + return node.kind === 318 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321 /* JSDocTypeTag */; + return node.kind === 320 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322 /* JSDocTemplateTag */; + return node.kind === 321 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323 /* JSDocTypedefTag */; + return node.kind === 322 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324 /* JSDocPropertyTag */; + return node.kind === 323 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; + return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305 /* JSDocTypeLiteral */; + return node.kind === 304 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316 /* JSDocCallbackTag */; + return node.kind === 315 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306 /* JSDocSignature */; + return node.kind === 305 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -12003,7 +12003,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 325 /* SyntaxList */; + return n.kind === 324 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12013,7 +12013,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 154 /* FirstNode */; + return kind >= 153 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12022,7 +12022,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12063,12 +12063,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.isTypeOnly; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12103,13 +12103,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12132,7 +12132,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 /* QualifiedName */ + return kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12142,14 +12142,14 @@ var ts; || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 155 /* ComputedPropertyName */; + || kind === 154 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 190 /* ObjectBindingPattern */ - || kind === 191 /* ArrayBindingPattern */; + || kind === 189 /* ObjectBindingPattern */ + || kind === 190 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12164,13 +12164,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: return false; @@ -12179,14 +12179,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 172 /* ConstructorType */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 171 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12201,29 +12201,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 160 /* PropertyDeclaration */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 168 /* IndexSignature */ - || kind === 223 /* SemicolonClassElement */; + return kind === 162 /* Constructor */ + || kind === 159 /* PropertyDeclaration */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 167 /* IndexSignature */ + || kind === 222 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); + return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); + return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; default: return false; @@ -12233,11 +12233,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 167 /* ConstructSignature */ - || kind === 166 /* CallSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */ - || kind === 168 /* IndexSignature */; + return kind === 166 /* ConstructSignature */ + || kind === 165 /* CallSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */ + || kind === 167 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12246,12 +12246,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 /* PropertyAssignment */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 284 /* SpreadAssignment */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 281 /* PropertyAssignment */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 283 /* SpreadAssignment */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12266,8 +12266,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return true; } return false; @@ -12278,8 +12278,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 /* ArrayBindingPattern */ - || kind === 190 /* ObjectBindingPattern */; + return kind === 190 /* ArrayBindingPattern */ + || kind === 189 /* ObjectBindingPattern */; } return false; } @@ -12287,15 +12287,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 /* ArrayLiteralExpression */ - || kind === 194 /* ObjectLiteralExpression */; + return kind === 192 /* ArrayLiteralExpression */ + || kind === 193 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 /* BindingElement */ - || kind === 216 /* OmittedExpression */; + return kind === 191 /* BindingElement */ + || kind === 215 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12304,9 +12304,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: return true; } return false; @@ -12327,8 +12327,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return true; } return false; @@ -12340,8 +12340,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return true; } return false; @@ -12350,26 +12350,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */ - || kind === 189 /* ImportType */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */ + || kind === 188 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: return true; default: return false; @@ -12377,12 +12377,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; + return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 /* TemplateExpression */ + return kind === 211 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12393,33 +12393,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 198 /* NewExpression */: - case 197 /* CallExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 199 /* TaggedTemplateExpression */: - case 193 /* ArrayLiteralExpression */: - case 201 /* ParenthesizedExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 198 /* TaggedTemplateExpression */: + case 192 /* ArrayLiteralExpression */: + case 200 /* ParenthesizedExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 219 /* NonNullExpression */: - case 220 /* MetaProperty */: + case 218 /* NonNullExpression */: + case 219 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12433,13 +12433,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 200 /* TypeAssertionExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 199 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12448,9 +12448,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12469,15 +12469,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: - case 203 /* ArrowFunction */: - case 210 /* BinaryExpression */: - case 214 /* SpreadElement */: - case 218 /* AsExpression */: - case 216 /* OmittedExpression */: - case 328 /* CommaListExpression */: - case 327 /* PartiallyEmittedExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: + case 202 /* ArrowFunction */: + case 209 /* BinaryExpression */: + case 213 /* SpreadElement */: + case 217 /* AsExpression */: + case 215 /* OmittedExpression */: + case 327 /* CommaListExpression */: + case 326 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12485,23 +12485,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 /* TypeAssertionExpression */ - || kind === 218 /* AsExpression */; + return kind === 199 /* TypeAssertionExpression */ + || kind === 217 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 327 /* PartiallyEmittedExpression */; + return node.kind === 326 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 326 /* NotEmittedStatement */; + return node.kind === 325 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 331 /* SyntheticReferenceExpression */; + return node.kind === 330 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12512,13 +12512,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12547,7 +12547,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; + return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12571,114 +12571,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */ + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */; + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 250 /* ModuleDeclaration */; + || kind === 249 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 /* NamedImports */ - || kind === 257 /* NamespaceImport */; + return kind === 257 /* NamedImports */ + || kind === 256 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; + return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 /* ArrowFunction */ - || kind === 192 /* BindingElement */ - || kind === 246 /* ClassDeclaration */ - || kind === 215 /* ClassExpression */ - || kind === 163 /* Constructor */ - || kind === 249 /* EnumDeclaration */ - || kind === 285 /* EnumMember */ - || kind === 264 /* ExportSpecifier */ - || kind === 245 /* FunctionDeclaration */ - || kind === 202 /* FunctionExpression */ - || kind === 164 /* GetAccessor */ - || kind === 256 /* ImportClause */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 259 /* ImportSpecifier */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 274 /* JsxAttribute */ - || kind === 162 /* MethodDeclaration */ - || kind === 161 /* MethodSignature */ - || kind === 250 /* ModuleDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 257 /* NamespaceImport */ - || kind === 263 /* NamespaceExport */ - || kind === 157 /* Parameter */ - || kind === 282 /* PropertyAssignment */ - || kind === 160 /* PropertyDeclaration */ - || kind === 159 /* PropertySignature */ - || kind === 165 /* SetAccessor */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 156 /* TypeParameter */ - || kind === 243 /* VariableDeclaration */ - || kind === 323 /* JSDocTypedefTag */ - || kind === 316 /* JSDocCallbackTag */ - || kind === 324 /* JSDocPropertyTag */; + return kind === 202 /* ArrowFunction */ + || kind === 191 /* BindingElement */ + || kind === 245 /* ClassDeclaration */ + || kind === 214 /* ClassExpression */ + || kind === 162 /* Constructor */ + || kind === 248 /* EnumDeclaration */ + || kind === 284 /* EnumMember */ + || kind === 263 /* ExportSpecifier */ + || kind === 244 /* FunctionDeclaration */ + || kind === 201 /* FunctionExpression */ + || kind === 163 /* GetAccessor */ + || kind === 255 /* ImportClause */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportSpecifier */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 273 /* JsxAttribute */ + || kind === 161 /* MethodDeclaration */ + || kind === 160 /* MethodSignature */ + || kind === 249 /* ModuleDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 256 /* NamespaceImport */ + || kind === 262 /* NamespaceExport */ + || kind === 156 /* Parameter */ + || kind === 281 /* PropertyAssignment */ + || kind === 159 /* PropertyDeclaration */ + || kind === 158 /* PropertySignature */ + || kind === 164 /* SetAccessor */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 155 /* TypeParameter */ + || kind === 242 /* VariableDeclaration */ + || kind === 322 /* JSDocTypedefTag */ + || kind === 315 /* JSDocCallbackTag */ + || kind === 323 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 265 /* MissingDeclaration */ - || kind === 246 /* ClassDeclaration */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 249 /* EnumDeclaration */ - || kind === 250 /* ModuleDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 260 /* ExportAssignment */ - || kind === 253 /* NamespaceExportDeclaration */; + return kind === 244 /* FunctionDeclaration */ + || kind === 264 /* MissingDeclaration */ + || kind === 245 /* ClassDeclaration */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 248 /* EnumDeclaration */ + || kind === 249 /* ModuleDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 259 /* ExportAssignment */ + || kind === 252 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 /* BreakStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 229 /* DoStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 225 /* EmptyStatement */ - || kind === 232 /* ForInStatement */ - || kind === 233 /* ForOfStatement */ - || kind === 231 /* ForStatement */ - || kind === 228 /* IfStatement */ - || kind === 239 /* LabeledStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 238 /* SwitchStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 241 /* TryStatement */ - || kind === 226 /* VariableStatement */ - || kind === 230 /* WhileStatement */ - || kind === 237 /* WithStatement */ - || kind === 326 /* NotEmittedStatement */ - || kind === 330 /* EndOfDeclarationMarker */ - || kind === 329 /* MergeDeclarationMarker */; + return kind === 234 /* BreakStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 228 /* DoStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 224 /* EmptyStatement */ + || kind === 231 /* ForInStatement */ + || kind === 232 /* ForOfStatement */ + || kind === 230 /* ForStatement */ + || kind === 227 /* IfStatement */ + || kind === 238 /* LabeledStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 237 /* SwitchStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 240 /* TryStatement */ + || kind === 225 /* VariableStatement */ + || kind === 229 /* WhileStatement */ + || kind === 236 /* WithStatement */ + || kind === 325 /* NotEmittedStatement */ + || kind === 329 /* EndOfDeclarationMarker */ + || kind === 328 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 156 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 155 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12705,10 +12705,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224 /* Block */) + if (node.kind !== 223 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { + if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { return false; } } @@ -12718,8 +12718,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 266 /* ExternalModuleReference */ - || kind === 154 /* QualifiedName */ + return kind === 265 /* ExternalModuleReference */ + || kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12729,70 +12729,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 195 /* PropertyAccessExpression */; + || kind === 194 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 267 /* JsxElement */ - || kind === 277 /* JsxExpression */ - || kind === 268 /* JsxSelfClosingElement */ + return kind === 266 /* JsxElement */ + || kind === 276 /* JsxExpression */ + || kind === 267 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 271 /* JsxFragment */; + || kind === 270 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 /* JsxAttribute */ - || kind === 276 /* JsxSpreadAttribute */; + return kind === 273 /* JsxAttribute */ + || kind === 275 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 277 /* JsxExpression */; + || kind === 276 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 /* JsxOpeningElement */ - || kind === 268 /* JsxSelfClosingElement */; + return kind === 268 /* JsxOpeningElement */ + || kind === 267 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 /* CaseClause */ - || kind === 279 /* DefaultClause */; + return kind === 277 /* CaseClause */ + || kind === 278 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; + return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; + return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12818,13 +12818,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: return true; default: return false; @@ -12832,12 +12832,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13132,7 +13132,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291 /* SourceFile */) { + while (node && node.kind !== 290 /* SourceFile */) { node = node.parent; } return node; @@ -13140,11 +13140,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return true; } return false; @@ -13339,7 +13339,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13464,7 +13464,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; + return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13496,11 +13496,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 && node.kind === 250 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 /* SourceFile */ || - node.kind === 250 /* ModuleDeclaration */ || + return node.kind === 290 /* SourceFile */ || + node.kind === 249 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13517,9 +13517,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node.parent); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13572,22 +13572,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 281 /* CatchClause */: - case 250 /* ModuleDeclaration */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 280 /* CatchClause */: + case 249 /* ModuleDeclaration */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 224 /* Block */: + case 223 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13597,9 +13597,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 306 /* JSDocSignature */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 305 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13609,25 +13609,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13637,8 +13637,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13647,15 +13647,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 226 /* VariableStatement */: - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 225 /* VariableStatement */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return true; default: return false; @@ -13692,7 +13692,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13708,9 +13708,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13771,7 +13771,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224 /* Block */) { + if (node.body && node.body.kind === 223 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13785,7 +13785,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13794,28 +13794,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: errorNode = node.name; break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13867,11 +13867,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13885,7 +13885,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 /* ExpressionStatement */ + return node.kind === 226 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13894,11 +13894,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 /* Parameter */ || - node.kind === 156 /* TypeParameter */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 203 /* ArrowFunction */ || - node.kind === 201 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 156 /* Parameter */ || + node.kind === 155 /* TypeParameter */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 202 /* ArrowFunction */ || + node.kind === 200 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13914,48 +13914,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 206 /* VoidExpression */; - case 217 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 205 /* VoidExpression */; + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156 /* TypeParameter */: - return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; + case 155 /* TypeParameter */: + return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 194 /* 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 === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 154 /* QualifiedName */: - case 195 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 173 /* TypeQuery */) { + if (parent.kind === 172 /* TypeQuery */) { return false; } - if (parent.kind === 189 /* ImportType */) { + if (parent.kind === 188 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13964,40 +13964,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return node === parent.constraint; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return node === parent.constraint; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return node === parent.type; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node === parent.type; - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return node === parent.type; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return node === parent.type; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14022,23 +14022,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitor(node); - case 252 /* CaseBlock */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 251 /* CaseBlock */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14048,23 +14048,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* 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(node.name.expression); @@ -14087,10 +14087,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 175 /* ArrayType */) { + if (node && node.kind === 174 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 170 /* TypeReference */) { + else if (node && node.kind === 169 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14100,12 +14100,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 174 /* TypeLiteral */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 173 /* TypeLiteral */: return node.members; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return node.properties; } } @@ -14113,14 +14113,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192 /* BindingElement */: - case 285 /* EnumMember */: - case 157 /* Parameter */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 284 /* EnumMember */: + case 156 /* Parameter */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 242 /* VariableDeclaration */: return true; } } @@ -14132,8 +14132,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ - && node.parent.parent.kind === 226 /* VariableStatement */; + return node.parent.kind === 243 /* VariableDeclarationList */ + && node.parent.parent.kind === 225 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14144,13 +14144,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return true; } return false; @@ -14161,7 +14161,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239 /* LabeledStatement */) { + if (node.statement.kind !== 238 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14169,17 +14169,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; + return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 /* MethodDeclaration */ && - (node.parent.kind === 194 /* ObjectLiteralExpression */ || - node.parent.kind === 215 /* ClassExpression */); + return node.kind === 161 /* MethodDeclaration */ && + (node.parent.kind === 193 /* ObjectLiteralExpression */ || + node.parent.kind === 214 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14192,7 +14192,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282 /* PropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14233,14 +14233,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291 /* SourceFile */); + ts.Debug.assert(node.kind !== 290 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* 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 @@ -14255,9 +14255,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14268,26 +14268,26 @@ var ts; node = node.parent; } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 250 /* ModuleDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 249 /* EnumDeclaration */: - case 291 /* SourceFile */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 249 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 248 /* EnumDeclaration */: + case 290 /* SourceFile */: return node; } } @@ -14297,9 +14297,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return container; } } @@ -14321,27 +14321,27 @@ var ts; return node; } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: node = node.parent; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14357,14 +14357,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { + if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 201 /* ParenthesizedExpression */) { + while (parent.kind === 200 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14380,7 +14380,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14389,20 +14389,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return node; } return undefined; @@ -14410,10 +14410,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return node.tag; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14426,25 +14426,25 @@ var ts; return false; } switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // classes are valid targets return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 246 /* ClassDeclaration */; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + return parent.kind === 245 /* ClassDeclaration */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 246 /* ClassDeclaration */; - case 157 /* Parameter */: + && parent.kind === 245 /* ClassDeclaration */; + case 156 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 163 /* Constructor */ - || parent.kind === 162 /* MethodDeclaration */ - || parent.kind === 165 /* SetAccessor */) - && grandparent.kind === 246 /* ClassDeclaration */; + && (parent.kind === 162 /* Constructor */ + || parent.kind === 161 /* MethodDeclaration */ + || parent.kind === 164 /* SetAccessor */) + && grandparent.kind === 245 /* ClassDeclaration */; } return false; } @@ -14460,10 +14460,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14472,9 +14472,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 /* JsxOpeningElement */ || - parent.kind === 268 /* JsxSelfClosingElement */ || - parent.kind === 270 /* JsxClosingElement */) { + if (parent.kind === 268 /* JsxOpeningElement */ || + parent.kind === 267 /* JsxSelfClosingElement */ || + parent.kind === 269 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14487,44 +14487,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 218 /* AsExpression */: - case 200 /* TypeAssertionExpression */: - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 210 /* BinaryExpression */: - case 211 /* ConditionalExpression */: - case 214 /* SpreadElement */: - case 212 /* TemplateExpression */: - case 216 /* OmittedExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 213 /* YieldExpression */: - case 207 /* AwaitExpression */: - case 220 /* MetaProperty */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 217 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 209 /* BinaryExpression */: + case 210 /* ConditionalExpression */: + case 213 /* SpreadElement */: + case 211 /* TemplateExpression */: + case 215 /* OmittedExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 212 /* YieldExpression */: + case 206 /* AwaitExpression */: + case 219 /* MetaProperty */: return true; - case 154 /* QualifiedName */: - while (node.parent.kind === 154 /* QualifiedName */) { + case 153 /* QualifiedName */: + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14542,49 +14542,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 191 /* BindingElement */: return parent.initializer === node; - case 227 /* ExpressionStatement */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 236 /* ReturnStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 240 /* ThrowStatement */: + case 226 /* ExpressionStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 235 /* ReturnStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 239 /* ThrowStatement */: return parent.expression === node; - case 231 /* ForStatement */: + case 230 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forInStatement.expression === node; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return node === parent.expression; - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return node === parent.expression; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return node === parent.expression; - case 158 /* Decorator */: - case 277 /* JsxExpression */: - case 276 /* JsxSpreadAttribute */: - case 284 /* SpreadAssignment */: + case 157 /* Decorator */: + case 276 /* JsxExpression */: + case 275 /* JsxSpreadAttribute */: + case 283 /* SpreadAssignment */: return true; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14592,14 +14592,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14608,7 +14608,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14640,11 +14640,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); + (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197 /* CallExpression */) { + if (callExpression.kind !== 196 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14776,11 +14776,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 202 /* FunctionExpression */ || - initializer.kind === 215 /* ClassExpression */ || - initializer.kind === 203 /* ArrowFunction */) { + if (initializer.kind === 201 /* FunctionExpression */ || + initializer.kind === 214 /* ClassExpression */ || + initializer.kind === 202 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15027,7 +15027,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15037,7 +15037,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15046,14 +15046,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.parent; - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return node.parent.parent; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 188 /* LiteralType */: + case 187 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15063,12 +15063,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.moduleSpecifier; - case 254 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 189 /* ImportType */: + case 253 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 188 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15077,11 +15077,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15089,7 +15089,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15110,13 +15110,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157 /* Parameter */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 283 /* ShorthandPropertyAssignment */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 282 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15130,7 +15130,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; + return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15155,12 +15155,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return node.initializer; } } @@ -15171,7 +15171,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 /* ModuleDeclaration */ + node.body.kind === 249 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15186,11 +15186,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156 /* TypeParameter */) { + if (node.kind === 155 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15201,10 +15201,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 /* PropertyAssignment */ || - parent.kind === 260 /* ExportAssignment */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || + if (parent.kind === 281 /* PropertyAssignment */ || + parent.kind === 259 /* ExportAssignment */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15278,7 +15278,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15295,31 +15295,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 201 /* ParenthesizedExpression */: - case 193 /* ArrayLiteralExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 192 /* ArrayLiteralExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: node = parent; break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15346,22 +15346,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224 /* Block */: - case 226 /* VariableStatement */: - case 237 /* WithStatement */: - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 223 /* Block */: + case 225 /* VariableStatement */: + case 236 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return true; } return false; @@ -15378,33 +15378,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183 /* ParenthesizedType */); + return walkUp(node, 182 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201 /* ParenthesizedExpression */); + return walkUp(node, 200 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { + while (node.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { + if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204 /* DeleteExpression */; + return node && node.kind === 203 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15457,7 +15454,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 /* ComputedPropertyName */ && + node.parent.kind === 154 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15465,32 +15462,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 195 /* PropertyAccessExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 194 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 154 /* QualifiedName */) { + while (parent.kind === 153 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; + return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; } return false; - case 192 /* BindingElement */: - case 259 /* ImportSpecifier */: + case 191 /* BindingElement */: + case 258 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 264 /* ExportSpecifier */: - case 274 /* JsxAttribute */: + case 263 /* ExportSpecifier */: + case 273 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15510,33 +15507,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 257 /* NamespaceImport */: - case 264 /* ExportSpecifier */: - case 260 /* ExportAssignment */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 256 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 259 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: return node.parent; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 154 /* QualifiedName */); + } while (node.parent.kind === 153 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15555,7 +15552,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : + return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15621,11 +15618,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15669,14 +15666,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15690,10 +15687,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15726,7 +15723,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { + if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15752,7 +15749,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15815,11 +15812,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157 /* Parameter */; + return root.kind === 156 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192 /* BindingElement */) { + while (node.kind === 191 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15827,15 +15824,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 202 /* FunctionExpression */ - || kind === 245 /* FunctionDeclaration */ - || kind === 203 /* ArrowFunction */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 250 /* ModuleDeclaration */ - || kind === 291 /* SourceFile */; + return kind === 162 /* Constructor */ + || kind === 201 /* FunctionExpression */ + || kind === 244 /* FunctionDeclaration */ + || kind === 202 /* ArrowFunction */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 249 /* ModuleDeclaration */ + || kind === 290 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15854,23 +15851,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: return 1 /* Right */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15894,15 +15891,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210 /* BinaryExpression */) { + if (expression.kind === 209 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { + else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15912,15 +15909,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return 0; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return 1; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return 2; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return 4; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15941,21 +15938,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: return 16; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return 17; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return 18; - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 19 : 18; - case 199 /* TaggedTemplateExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 198 /* TaggedTemplateExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15966,19 +15963,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 201 /* ParenthesizedExpression */: - case 216 /* OmittedExpression */: + case 211 /* TemplateExpression */: + case 200 /* ParenthesizedExpression */: + case 215 /* OmittedExpression */: return 20; default: return -1; @@ -16589,10 +16586,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 165 /* SetAccessor */) { + else if (accessor.kind === 164 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16612,10 +16609,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 /* GetAccessor */ && !getAccessor) { + if (member.kind === 163 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 165 /* SetAccessor */ && !setAccessor) { + if (member.kind === 164 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16664,7 +16661,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16888,7 +16885,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16930,11 +16927,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 131 /* DeclareKeyword */: return 2 /* Ambient */; + case 130 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16974,8 +16971,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 194 /* ObjectLiteralExpression */ - || kind === 193 /* ArrayLiteralExpression */; + return kind === 193 /* ObjectLiteralExpression */ + || kind === 192 /* ArrayLiteralExpression */; } return false; } @@ -16992,12 +16989,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -17007,8 +17004,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17038,17 +17035,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 /* ObjectLiteralExpression */ && + return expression.kind === 193 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 /* ArrayLiteralExpression */ && + return expression.kind === 192 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17372,8 +17369,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17450,35 +17447,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return accessKind(parent); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 282 /* PropertyAssignment */: { + case 281 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17627,39 +17624,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) + return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 149 /* UnknownKeyword */ - || kind === 141 /* NumberKeyword */ - || kind === 152 /* BigIntKeyword */ - || kind === 142 /* ObjectKeyword */ - || kind === 129 /* BooleanKeyword */ - || kind === 144 /* StringKeyword */ - || kind === 145 /* SymbolKeyword */ + || kind === 148 /* UnknownKeyword */ + || kind === 140 /* NumberKeyword */ + || kind === 151 /* BigIntKeyword */ + || kind === 141 /* ObjectKeyword */ + || kind === 128 /* BooleanKeyword */ + || kind === 143 /* StringKeyword */ + || kind === 144 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 147 /* UndefinedKeyword */ + || kind === 146 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 138 /* NeverKeyword */ - || kind === 217 /* ExpressionWithTypeArguments */ - || kind === 296 /* JSDocAllType */ - || kind === 297 /* JSDocUnknownType */ - || kind === 298 /* JSDocNullableType */ - || kind === 299 /* JSDocNonNullableType */ - || kind === 300 /* JSDocOptionalType */ - || kind === 301 /* JSDocFunctionType */ - || kind === 302 /* JSDocVariadicType */; + || kind === 137 /* NeverKeyword */ + || kind === 216 /* ExpressionWithTypeArguments */ + || kind === 295 /* JSDocAllType */ + || kind === 296 /* JSDocUnknownType */ + || kind === 297 /* JSDocNullableType */ + || kind === 298 /* JSDocNonNullableType */ + || kind === 299 /* JSDocOptionalType */ + || kind === 300 /* JSDocFunctionType */ + || kind === 301 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195 /* PropertyAccessExpression */) { + if (node.kind === 194 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17674,7 +17671,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; + return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18758,21 +18755,21 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; + return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { @@ -18780,16 +18777,16 @@ var ts; return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return true; - case 195 /* PropertyAccessExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 194 /* PropertyAccessExpression */: + case 216 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18809,7 +18806,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291 /* SourceFile */) { + if (kind === 290 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18864,19 +18861,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153 /* LastToken */) { + if (!node || node.kind <= 152 /* LastToken */) { return; } switch (node.kind) { - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18884,9 +18881,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18894,7 +18891,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18902,51 +18899,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18958,359 +18955,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 176 /* TupleType */: + case 175 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182 /* InferType */: + case 181 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 189 /* ImportType */: + case 188 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183 /* ParenthesizedType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 184 /* TypeOperator */: return visitNode(cbNode, node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187 /* MappedType */: + case 186 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return visitNode(cbNode, node.literal); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitNode(cbNode, node.name); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return visitNode(cbNode, node.label); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158 /* Decorator */: + case 157 /* Decorator */: return visitNode(cbNode, node.expression); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 177 /* OptionalType */: - case 178 /* RestType */: - case 295 /* JSDocTypeExpression */: - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 300 /* JSDocOptionalType */: - case 302 /* JSDocVariadicType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 294 /* JSDocTypeExpression */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 299 /* JSDocOptionalType */: + case 301 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310 /* JSDocAuthorTag */: + case 309 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 /* JSDocTypeExpression */ + node.typeExpression.kind === 294 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307 /* JSDocTag */: - case 311 /* JSDocClassTag */: - case 312 /* JSDocPublicTag */: - case 313 /* JSDocPrivateTag */: - case 314 /* JSDocProtectedTag */: - case 315 /* JSDocReadonlyTag */: + case 306 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 311 /* JSDocPublicTag */: + case 312 /* JSDocPrivateTag */: + case 313 /* JSDocProtectedTag */: + case 314 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19599,7 +19596,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227 /* ExpressionStatement */); + var statement = createNode(226 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19751,7 +19748,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -20083,7 +20080,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 226 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20195,7 +20192,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(155 /* ComputedPropertyName */); + var node = createNode(154 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20237,15 +20234,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146 /* TypeKeyword */) { + if (token() === 145 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20655,20 +20652,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163 /* Constructor */: - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 223 /* SemicolonClassElement */: + case 162 /* Constructor */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 222 /* SemicolonClassElement */: return true; - case 162 /* MethodDeclaration */: + case 161 /* 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 === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20677,8 +20674,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return true; } } @@ -20687,58 +20684,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 226 /* VariableStatement */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 227 /* ExpressionStatement */: - case 240 /* ThrowStatement */: - case 236 /* ReturnStatement */: - case 238 /* SwitchStatement */: - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 225 /* EmptyStatement */: - case 241 /* TryStatement */: - case 239 /* LabeledStatement */: - case 229 /* DoStatement */: - case 242 /* DebuggerStatement */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 225 /* VariableStatement */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 226 /* ExpressionStatement */: + case 239 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 237 /* SwitchStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 224 /* EmptyStatement */: + case 240 /* TryStatement */: + case 238 /* LabeledStatement */: + case 228 /* DoStatement */: + case 241 /* DebuggerStatement */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 159 /* PropertySignature */: - case 166 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 158 /* PropertySignature */: + case 165 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243 /* VariableDeclaration */) { + if (node.kind !== 242 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20759,7 +20756,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157 /* Parameter */) { + if (node.kind !== 156 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20898,7 +20895,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154 /* QualifiedName */, entity.pos); + var node = createNode(153 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20939,7 +20936,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212 /* TemplateExpression */); + var template = createNode(211 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20951,7 +20948,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222 /* TemplateSpan */); + var span = createNode(221 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -21017,7 +21014,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -21027,14 +21024,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: { + case 170 /* FunctionType */: + case 171 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -21042,20 +21039,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169 /* TypePredicate */, lhs.pos); + var node = createNode(168 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184 /* ThisType */); + var node = createNode(183 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296 /* JSDocAllType */); + var result = createNode(295 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(300 /* JSDocOptionalType */, result); + return createPostfixType(299 /* JSDocOptionalType */, result); } else { nextToken(); @@ -21063,7 +21060,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299 /* JSDocNonNullableType */); + var result = createNode(298 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -21087,28 +21084,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(297 /* JSDocUnknownType */, pos); + var result = createNode(296 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(298 /* JSDocNullableType */, pos); + var result = createNode(297 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157 /* Parameter */); + var parameter = createNode(156 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -21118,9 +21115,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -21139,23 +21136,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(300 /* JSDocOptionalType */, type); + return createPostfixType(299 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(173 /* TypeQuery */); + var node = createNode(172 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21200,7 +21197,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157 /* Parameter */); + var node = createNodeWithJSDoc(156 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21301,7 +21298,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167 /* ConstructSignature */) { + if (kind === 166 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21362,7 +21359,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 168 /* IndexSignature */; + node.kind = 167 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21372,13 +21369,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 161 /* MethodSignature */; + node.kind = 160 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 159 /* PropertySignature */; + node.kind = 158 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21424,10 +21421,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(166 /* CallSignature */); + return parseSignatureMember(165 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167 /* ConstructSignature */); + return parseSignatureMember(166 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21453,7 +21450,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174 /* TypeLiteral */); + var node = createNode(173 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21471,27 +21468,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 139 /* ReadonlyKeyword */; + return nextToken() === 138 /* ReadonlyKeyword */; } - if (token() === 139 /* ReadonlyKeyword */) { + if (token() === 138 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187 /* MappedType */); + var node = createNode(186 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { - parseExpectedToken(139 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + parseExpectedToken(138 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21511,23 +21508,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(178 /* RestType */, pos); + var node = createNode(177 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 177 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 176 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(176 /* TupleType */); + var node = createNode(175 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183 /* ParenthesizedType */); + var node = createNode(182 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21535,7 +21532,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21545,10 +21542,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188 /* LiteralType */); + var node = createNode(187 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21569,7 +21566,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(189 /* ImportType */); + var node = createNode(188 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21592,15 +21589,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 145 /* SymbolKeyword */: - case 129 /* BooleanKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 144 /* SymbolKeyword */: + case 128 /* BooleanKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21631,7 +21628,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21657,20 +21654,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 139 /* ReadonlyKeyword */: - case 145 /* SymbolKeyword */: - case 148 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 138 /* ReadonlyKeyword */: + case 144 /* SymbolKeyword */: + case 147 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21682,12 +21679,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21712,26 +21709,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(299 /* JSDocNonNullableType */, type); + type = createPostfixType(298 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298 /* JSDocNullableType */, type); + type = createPostfixType(297 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(186 /* IndexedAccessType */, type.pos); + var node = createNode(185 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(175 /* ArrayType */, type.pos); + var node = createNode(174 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21750,16 +21747,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185 /* TypeOperator */); + var node = createNode(184 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182 /* InferType */); - parseExpected(133 /* InferKeyword */); - var typeParameter = createNode(156 /* TypeParameter */); + var node = createNode(181 /* InferType */); + parseExpected(132 /* InferKeyword */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21767,12 +21764,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135 /* KeyOfKeyword */: - case 148 /* UniqueKeyword */: - case 139 /* ReadonlyKeyword */: - case 128 /* AwaitedKeyword */: + case 134 /* KeyOfKeyword */: + case 147 /* UniqueKeyword */: + case 138 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21793,10 +21789,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21853,7 +21849,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21865,16 +21861,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169 /* TypePredicate */); + var node = createNode(168 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21888,7 +21884,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(181 /* ConditionalType */, type.pos); + var node = createNode(180 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -22083,7 +22079,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213 /* YieldExpression */); + var node = createNode(212 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -22105,13 +22101,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203 /* ArrowFunction */, asyncModifier.pos); + node = createNode(202 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203 /* ArrowFunction */, identifier.pos); + node = createNode(202 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(157 /* Parameter */, identifier.pos); + var parameter = createNode(156 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22316,7 +22312,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203 /* ArrowFunction */); + var node = createNodeWithJSDoc(202 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22382,7 +22378,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22397,7 +22393,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22462,39 +22458,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210 /* BinaryExpression */, left.pos); + var node = createNode(209 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218 /* AsExpression */, left.pos); + var node = createNode(217 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204 /* DeleteExpression */); + var node = createNode(203 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205 /* TypeOfExpression */); + var node = createNode(204 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206 /* VoidExpression */); + var node = createNode(205 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22510,7 +22506,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207 /* AwaitExpression */); + var node = createNode(206 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22554,7 +22550,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { parseErrorAt(pos, end, 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 { @@ -22651,7 +22647,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22664,7 +22660,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22720,7 +22716,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(220 /* MetaProperty */, fullStart); + var node = createNode(219 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22803,7 +22799,7 @@ var ts; } // 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(195 /* PropertyAccessExpression */, expression.pos); + var node = createNode(194 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22813,8 +22809,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269 /* JsxOpeningElement */) { - var node = createNode(267 /* JsxElement */, opening.pos); + if (opening.kind === 268 /* JsxOpeningElement */) { + var node = createNode(266 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22823,15 +22819,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272 /* JsxOpeningFragment */) { - var node = createNode(271 /* JsxFragment */, opening.pos); + else if (opening.kind === 271 /* JsxOpeningFragment */) { + var node = createNode(270 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22846,7 +22842,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210 /* BinaryExpression */, result.pos); + var badNode = createNode(209 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22909,7 +22905,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275 /* JsxAttributes */); + var jsxAttributes = createNode(274 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22918,7 +22914,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22930,7 +22926,7 @@ var ts; // 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(269 /* JsxOpeningElement */, fullStart); + node = createNode(268 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22942,7 +22938,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(268 /* JsxSelfClosingElement */, fullStart); + node = createNode(267 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22959,7 +22955,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22967,7 +22963,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277 /* JsxExpression */); + var node = createNode(276 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22993,7 +22989,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274 /* JsxAttribute */); + var node = createNode(273 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -23008,7 +23004,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276 /* JsxSpreadAttribute */); + var node = createNode(275 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -23016,7 +23012,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270 /* JsxClosingElement */); + var node = createNode(269 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -23029,7 +23025,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273 /* JsxClosingFragment */); + var node = createNode(272 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -23044,7 +23040,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200 /* TypeAssertionExpression */); + var node = createNode(199 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -23061,12 +23057,33 @@ var ts; return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32 /* OptionalChain */) { + return true; + } + // check for an optional chain in a non-null expression + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + expr = expr.expression; + } + if (expr.flags & 32 /* OptionalChain */) { + // this is part of an optional chain. Walk down from `node` to `expression` and set the flag. + while (ts.isNonNullExpression(node)) { + node.flags |= 32 /* OptionalChain */; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32 /* OptionalChain */; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -23075,7 +23092,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -23089,7 +23106,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32 /* OptionalChain */; } return finishNode(indexedAccess); @@ -23111,7 +23128,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -23132,7 +23149,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -23160,12 +23177,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23173,11 +23190,11 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23185,7 +23202,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23304,28 +23321,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214 /* SpreadElement */); + var node = createNode(213 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193 /* ArrayLiteralExpression */); + var node = createNode(192 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23337,17 +23354,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 284 /* SpreadAssignment */; + node.kind = 283 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23365,7 +23382,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 283 /* ShorthandPropertyAssignment */; + node.kind = 282 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23373,14 +23390,14 @@ var ts; } } else { - node.kind = 282 /* PropertyAssignment */; + node.kind = 281 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194 /* ObjectLiteralExpression */); + var node = createNode(193 /* ObjectLiteralExpression */); var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { @@ -23405,7 +23422,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(202 /* FunctionExpression */); + var node = createNodeWithJSDoc(201 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23430,7 +23447,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(220 /* MetaProperty */, fullStart); + var node_2 = createNode(219 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23447,7 +23464,7 @@ var ts; } break; } - var node = createNode(198 /* NewExpression */, fullStart); + var node = createNode(197 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23457,7 +23474,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224 /* Block */); + var node = createNode(223 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23496,12 +23513,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225 /* EmptyStatement */); + var node = createNode(224 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(228 /* IfStatement */); + var node = createNode(227 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23511,7 +23528,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229 /* DoStatement */); + var node = createNode(228 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23526,7 +23543,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230 /* WhileStatement */); + var node = createNode(229 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23549,8 +23566,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { - var forOfStatement = createNode(233 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { + var forOfStatement = createNode(232 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23558,14 +23575,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(232 /* ForInStatement */, pos); + var forInStatement = createNode(231 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231 /* ForStatement */, pos); + var forStatement = createNode(230 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23583,7 +23600,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23591,7 +23608,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236 /* ReturnStatement */); + var node = createNode(235 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23600,7 +23617,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237 /* WithStatement */); + var node = createNode(236 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23609,7 +23626,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278 /* CaseClause */); + var node = createNode(277 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23617,7 +23634,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279 /* DefaultClause */); + var node = createNode(278 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23627,12 +23644,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238 /* SwitchStatement */); + var node = createNode(237 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(252 /* CaseBlock */); + var caseBlock = createNode(251 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23647,7 +23664,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(240 /* ThrowStatement */); + var node = createNode(239 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23655,7 +23672,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(241 /* TryStatement */); + var node = createNode(240 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23668,7 +23685,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281 /* CatchClause */); + var result = createNode(280 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23682,7 +23699,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242 /* DebuggerStatement */); + var node = createNode(241 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23691,15 +23708,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 226 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 239 /* LabeledStatement */; + node.kind = 238 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227 /* ExpressionStatement */; + node.kind = 226 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23753,25 +23770,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23780,7 +23797,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 146 /* TypeKeyword */) { + if (currentToken_1 === 145 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23834,19 +23851,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 146 /* TypeKeyword */: - case 151 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 145 /* TypeKeyword */: + case 150 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23870,16 +23887,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23889,9 +23906,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(234 /* ContinueStatement */); + return parseBreakOrContinueStatement(233 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(235 /* BreakStatement */); + return parseBreakOrContinueStatement(234 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23912,10 +23929,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 131 /* DeclareKeyword */: + case 145 /* TypeKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23925,8 +23942,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: - case 151 /* GlobalKeyword */: + case 138 /* ReadonlyKeyword */: + case 150 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23935,7 +23952,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131 /* DeclareKeyword */; + return modifier.kind === 130 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23983,13 +24000,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 151 /* GlobalKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 150 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -24008,7 +24025,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -24031,16 +24048,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(216 /* OmittedExpression */); + return createNode(215 /* OmittedExpression */); } - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -24056,14 +24073,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190 /* ObjectBindingPattern */); + var node = createNode(189 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191 /* ArrayBindingPattern */); + var node = createNode(190 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -24088,7 +24105,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243 /* VariableDeclaration */); + var node = createNode(242 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -24101,7 +24118,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244 /* VariableDeclarationList */); + var node = createNode(243 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -24124,7 +24141,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -24139,13 +24156,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 226 /* VariableStatement */; + node.kind = 225 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245 /* FunctionDeclaration */; + node.kind = 244 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -24156,8 +24173,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130 /* ConstructorKeyword */) { - return parseExpected(130 /* ConstructorKeyword */); + if (token() === 129 /* ConstructorKeyword */) { + return parseExpected(129 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -24169,7 +24186,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163 /* Constructor */; + node.kind = 162 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -24177,7 +24194,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162 /* MethodDeclaration */; + node.kind = 161 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -24186,7 +24203,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160 /* PropertyDeclaration */; + node.kind = 159 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24248,7 +24265,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24280,7 +24297,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(158 /* Decorator */, decoratorStart); + var decorator = createNode(157 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24330,20 +24347,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(223 /* SemicolonClassElement */); + var result = createNode(222 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } - if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24380,10 +24397,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24426,14 +24443,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(280 /* HeritageClause */); + var node = createNode(279 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24449,7 +24466,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247 /* InterfaceDeclaration */; + node.kind = 246 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24458,8 +24475,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248 /* TypeAliasDeclaration */; - parseExpected(146 /* TypeKeyword */); + node.kind = 247 /* TypeAliasDeclaration */; + parseExpected(145 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24472,13 +24489,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(285 /* EnumMember */); + var node = createNodeWithJSDoc(284 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249 /* EnumDeclaration */; + node.kind = 248 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24491,7 +24508,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251 /* ModuleBlock */); + var node = createNode(250 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24502,7 +24519,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250 /* ModuleDeclaration */; + node.kind = 249 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24514,8 +24531,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250 /* ModuleDeclaration */; - if (token() === 151 /* GlobalKeyword */) { + node.kind = 249 /* ModuleDeclaration */; + if (token() === 150 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24534,15 +24551,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151 /* GlobalKeyword */) { + if (token() === 150 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137 /* NamespaceKeyword */)) { + else if (parseOptional(136 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(136 /* ModuleKeyword */); + parseExpected(135 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24550,7 +24567,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 /* RequireKeyword */ && + return token() === 139 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24560,9 +24577,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 253 /* NamespaceExportDeclaration */; + node.kind = 252 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(137 /* NamespaceKeyword */); + parseExpected(136 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24575,7 +24592,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 /* FromKeyword */ && + if (token() !== 149 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24585,7 +24602,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 255 /* ImportDeclaration */; + node.kind = 254 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24594,7 +24611,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24606,10 +24623,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254 /* ImportEqualsDeclaration */; + node.kind = 253 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24627,7 +24644,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(256 /* ImportClause */, fullStart); + var importClause = createNode(255 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24638,7 +24655,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); } return finishNode(importClause); } @@ -24648,8 +24665,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(266 /* ExternalModuleReference */); - parseExpected(140 /* RequireKeyword */); + var node = createNode(265 /* ExternalModuleReference */); + parseExpected(139 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24671,7 +24688,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(257 /* NamespaceImport */); + var namespaceImport = createNode(256 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24686,14 +24703,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264 /* ExportSpecifier */); + return parseImportOrExportSpecifier(263 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259 /* ImportSpecifier */); + return parseImportOrExportSpecifier(258 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24718,34 +24735,34 @@ var ts; else { node.name = identifierName; } - if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263 /* NamespaceExport */, pos); + var node = createNode(262 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(146 /* TypeKeyword */); + node.kind = 260 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(145 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(150 /* FromKeyword */); + if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24753,7 +24770,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260 /* ExportAssignment */; + node.kind = 259 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24773,10 +24790,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ - || node.kind === 255 /* ImportDeclaration */ - || node.kind === 260 /* ExportAssignment */ - || node.kind === 261 /* ExportDeclaration */ ? node : undefined; + || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ + || node.kind === 254 /* ImportDeclaration */ + || node.kind === 259 /* ExportAssignment */ + || node.kind === 260 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24842,7 +24859,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295 /* JSDocTypeExpression */); + var result = createNode(294 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -25005,7 +25022,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304 /* JSDocComment */, start); + var result = createNode(303 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -25075,19 +25092,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25222,7 +25239,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307 /* JSDocTag */, start); + var result = createNode(306 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25267,9 +25284,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25285,8 +25302,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(324 /* JSDocPropertyTag */, start) : - createNode(318 /* JSDocParameterTag */, start); + createNode(323 /* JSDocPropertyTag */, start) : + createNode(317 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25303,20 +25320,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { + if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25328,7 +25345,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319 /* JSDocReturnTag */, start); + var result = createNode(318 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25337,13 +25354,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321 /* JSDocTypeTag */, start); + var result = createNode(320 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310 /* JSDocAuthorTag */, start); + var result = createNode(309 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25397,20 +25414,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309 /* JSDocImplementsTag */, start); + var result = createNode(308 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308 /* JSDocAugmentsTag */, start); + var result = createNode(307 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25422,7 +25439,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(195 /* PropertyAccessExpression */, node.pos); + var prop = createNode(194 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25435,14 +25452,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320 /* JSDocThisTag */, start); + var tag = createNode(319 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317 /* JSDocEnumTag */, start); + var tag = createNode(316 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25451,7 +25468,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323 /* JSDocTypedefTag */, start); + var typedefTag = createNode(322 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25465,9 +25482,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); } - if (child.kind === 321 /* JSDocTypeTag */) { + if (child.kind === 320 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25480,7 +25497,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25499,7 +25516,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25513,14 +25530,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316 /* JSDocCallbackTag */, start); + var callbackTag = createNode(315 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306 /* JSDocSignature */, start); + var jsdocSignature = createNode(305 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25528,7 +25545,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 319 /* JSDocReturnTag */) { + if (tag && tag.kind === 318 /* JSDocReturnTag */) { return tag; } } @@ -25573,7 +25590,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && + if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25637,13 +25654,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156 /* TypeParameter */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(322 /* JSDocTemplateTag */, start); + var result = createNode(321 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -27952,7 +27969,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282 /* PropertyAssignment */) { + if (element.kind !== 281 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -28043,13 +28060,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -28066,7 +28083,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30494,26 +30511,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30529,7 +30546,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 251 /* ModuleBlock */: { + case 250 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30551,7 +30568,7 @@ var ts; }); return state_1; } - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30759,7 +30776,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 260 /* ExportAssignment */) { + if (node.kind === 259 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30768,7 +30785,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30796,36 +30813,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "__constructor" /* Constructor */; - case 171 /* FunctionType */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: return "__call" /* Call */; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return "__new" /* New */; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "__index" /* Index */; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 157 /* Parameter */: + case 156 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30925,7 +30942,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30964,7 +30981,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -31031,7 +31048,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -31064,7 +31081,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -31079,13 +31096,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -31129,8 +31146,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -31162,90 +31179,93 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: bindWhileStatement(node); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: bindDoStatement(node); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: bindForStatement(node); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: bindIfStatement(node); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: bindTryStatement(node); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: bindSwitchStatement(node); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: bindCaseBlock(node); break; - case 278 /* CaseClause */: + case 277 /* CaseClause */: bindCaseClause(node); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: bindLabeledStatement(node); break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: bindCallExpressionFlow(node); break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 218 /* NonNullExpression */: + bindNonNullExpressionFlow(node); + break; + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 291 /* SourceFile */: { + case 290 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31258,18 +31278,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return hasNarrowableArgument(expr); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31291,7 +31311,7 @@ var ts; } } } - if (expr.expression.kind === 195 /* PropertyAccessExpression */ && + if (expr.expression.kind === 194 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31324,9 +31344,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31402,26 +31422,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return parent.expression === node; - case 231 /* ForStatement */: - case 211 /* ConditionalExpression */: + case 230 /* ForStatement */: + case 210 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201 /* ParenthesizedExpression */) { + if (node.kind === 200 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31463,7 +31483,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239 /* LabeledStatement */) { + while (label && node.parent.kind === 238 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31514,12 +31534,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233 /* ForOfStatement */) { + if (node.kind === 232 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244 /* VariableDeclarationList */) { + if (node.initializer.kind !== 243 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31541,7 +31561,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236 /* ReturnStatement */) { + if (node.kind === 235 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31558,7 +31578,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31658,7 +31678,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31707,7 +31727,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 197 /* CallExpression */) { + if (node.expression.kind === 196 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31733,7 +31753,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31744,10 +31764,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 193 /* ArrayLiteralExpression */) { + else if (node.kind === 192 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214 /* SpreadElement */) { + if (e.kind === 213 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31755,16 +31775,16 @@ var ts; } } } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282 /* PropertyAssignment */) { + if (p.kind === 281 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283 /* ShorthandPropertyAssignment */) { + else if (p.kind === 282 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284 /* SpreadAssignment */) { + else if (p.kind === 283 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31886,7 +31906,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31948,7 +31968,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31987,14 +32007,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162 /* MethodDeclaration */) { + if (host && host.kind !== 161 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -32006,15 +32026,17 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: + bind(node.questionDotToken); bind(node.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -32032,7 +32054,7 @@ var ts; // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest // of the node as part of the "true" branch, and continue to do so as we ascend back up to the outermost // chain node. We then treat the entire node as the right side of the expression. - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -32053,6 +32075,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -32070,7 +32100,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { + if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -32079,7 +32109,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -32088,54 +32118,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 275 /* JsxAttributes */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 274 /* JsxAttributes */: return 1 /* IsContainer */; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 301 /* JSDocFunctionType */: - case 171 /* FunctionType */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 172 /* ConstructorType */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 300 /* JSDocFunctionType */: + case 170 /* FunctionType */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 171 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 281 /* CatchClause */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 252 /* CaseBlock */: + case 280 /* CatchClause */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 251 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 224 /* Block */: + case 223 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -32168,45 +32198,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 194 /* ObjectLiteralExpression */: - case 247 /* InterfaceDeclaration */: - case 275 /* JsxAttributes */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 193 /* ObjectLiteralExpression */: + case 246 /* InterfaceDeclaration */: + case 274 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 306 /* JSDocSignature */: - case 168 /* IndexSignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 301 /* JSDocFunctionType */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 305 /* JSDocSignature */: + case 167 /* IndexSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 300 /* JSDocFunctionType */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32307,7 +32337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32319,7 +32349,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ + var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32351,10 +32381,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32540,8 +32570,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 291 /* SourceFile */ && - blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 290 /* SourceFile */ && + blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32636,7 +32666,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 153 /* LastToken */) { + if (node.kind > 152 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32712,14 +32742,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32734,7 +32764,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32762,78 +32792,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return checkStrictModeCatchClause(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkStrictModeWithStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 184 /* ThisType */: + case 183 /* ThisType */: seenThisKeyword = true; return; - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: break; // Binding the children will handle everything - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return bindTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return bindParameter(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return bindPropertyWorker(node); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: + case 171 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 187 /* MappedType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 186 /* MappedType */: return bindAnonymousTypeWorker(node); - case 311 /* JSDocClassTag */: + case 310 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return bindFunctionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32852,65 +32882,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return bindJsxAttributes(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return bindImportClause(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return bindExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return bindExportAssignment(node); - case 291 /* SourceFile */: + case 290 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224 /* Block */: + case 223 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 318 /* JSDocParameterTag */: - if (node.parent.kind === 306 /* JSDocSignature */) { + case 317 /* JSDocParameterTag */: + if (node.parent.kind === 305 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { break; } // falls through - case 324 /* JSDocPropertyTag */: + case 323 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -33066,8 +33096,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -33089,11 +33119,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -33105,7 +33135,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -33135,7 +33165,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -33175,7 +33205,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33277,8 +33307,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ - : propertyAccess.parent.parent.kind === 291 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ + : propertyAccess.parent.parent.kind === 290 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33357,7 +33387,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246 /* ClassDeclaration */) { + if (node.kind === 245 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33420,7 +33450,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { + if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33497,7 +33527,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 182 /* InferType */) { + else if (node.parent.kind === 181 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33525,11 +33555,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || // report error on class declarations - node.kind === 246 /* ClassDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33573,12 +33603,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33627,58 +33657,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 157 /* Parameter */: + case 156 /* Parameter */: return computeParameter(node, subtreeFlags); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163 /* Constructor */: + case 162 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33729,12 +33759,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33782,8 +33812,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 218 /* AsExpression */ - || expressionKind === 200 /* TypeAssertionExpression */) { + if (expressionKind === 217 /* AsExpression */ + || expressionKind === 199 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -34131,13 +34161,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -34146,27 +34176,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 219 /* NonNullExpression */: - case 139 /* ReadonlyKeyword */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 218 /* NonNullExpression */: + case 138 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: case 11 /* JsxText */: - case 270 /* JsxClosingElement */: - case 271 /* JsxFragment */: - case 272 /* JsxOpeningFragment */: - case 273 /* JsxClosingFragment */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 277 /* JsxExpression */: + case 269 /* JsxClosingElement */: + case 270 /* JsxFragment */: + case 271 /* JsxOpeningFragment */: + case 272 /* JsxClosingFragment */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 276 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -34179,16 +34209,16 @@ var ts; break; } // falls through - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 212 /* TemplateExpression */: - case 283 /* ShorthandPropertyAssignment */: + case 211 /* TemplateExpression */: + case 282 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34205,70 +34235,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 169 /* TypePredicate */: - case 170 /* TypeReference */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 173 /* TypeQuery */: - case 174 /* TypeLiteral */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 182 /* InferType */: - case 183 /* ParenthesizedType */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: - case 253 /* NamespaceExportDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 168 /* TypePredicate */: + case 169 /* TypeReference */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 172 /* TypeQuery */: + case 173 /* TypeLiteral */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 181 /* InferType */: + case 182 /* ParenthesizedType */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: + case 252 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34280,28 +34310,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34314,29 +34344,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34357,67 +34387,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { + if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 193 /* ArrayLiteralExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 192 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 157 /* Parameter */: + case 156 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 163 /* Constructor */: + case 162 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 144 /* StringKeyword */: - case 142 /* ObjectKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 143 /* StringKeyword */: + case 141 /* ObjectKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 281 /* CatchClause */: + case 280 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: - case 201 /* ParenthesizedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: + case 200 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34592,7 +34622,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 173 /* TypeQuery */) { + if (d.type && d.type.kind === 172 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35234,7 +35264,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35800,7 +35829,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35858,17 +35887,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 192 /* BindingElement */) { + if (declaration.kind === 191 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); } - else if (declaration.kind === 243 /* VariableDeclaration */) { + else if (declaration.kind === 242 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35899,12 +35928,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35924,9 +35953,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226 /* VariableStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 225 /* VariableStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35947,16 +35976,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 /* PropertyDeclaration */ && + current.parent.kind === 159 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 162 /* MethodDeclaration */) { + if (declaration.kind === 161 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35978,19 +36007,19 @@ var ts; return "quit"; } switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224 /* Block */: + case 223 /* Block */: switch (node.parent.kind) { - case 164 /* GetAccessor */: - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return true; default: return false; @@ -36036,12 +36065,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 157 /* Parameter */ || - lastLocation.kind === 156 /* TypeParameter */ + lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 155 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -36058,13 +36087,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181 /* ConditionalType */) { + else if (location.kind === 180 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -36079,14 +36108,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -36110,7 +36139,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { break; } } @@ -36124,12 +36153,12 @@ var ts; } } break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -36146,9 +36175,9 @@ var ts; } } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -36167,7 +36196,7 @@ var ts; } break loop; } - if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36175,7 +36204,7 @@ var ts; } } break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -36195,9 +36224,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36205,24 +36234,24 @@ var ts; } } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36235,7 +36264,7 @@ var ts; } } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36244,7 +36273,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 157 /* Parameter */) { + if (location.parent && location.parent.kind === 156 /* Parameter */) { location = location.parent; } // @@ -36259,25 +36288,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { location = location.parent; } break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 157 /* Parameter */: + case 156 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157 /* Parameter */) { + if (root.kind === 156 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36297,7 +36326,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36414,10 +36443,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { + if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36430,12 +36459,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: // For `namespace N { N; }` + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36447,7 +36476,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156 /* TypeParameter */) { + if (decl.kind === 155 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36503,9 +36532,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36549,7 +36578,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36608,7 +36637,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36643,13 +36672,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36673,28 +36702,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36995,28 +37024,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 260 /* ExportAssignment */: - case 210 /* BinaryExpression */: + case 259 /* ExportAssignment */: + case 209 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -37168,13 +37197,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -37198,9 +37227,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { - var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { + var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37235,7 +37264,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37457,7 +37486,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37744,7 +37773,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37831,12 +37860,12 @@ var ts; } } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37845,9 +37874,9 @@ var ts; return { value: result }; } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37930,7 +37959,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37974,7 +38003,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37989,10 +38018,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: continue; default: return false; @@ -38123,10 +38152,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38173,14 +38202,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 173 /* TypeQuery */ || + if (entityName.parent.kind === 172 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155 /* ComputedPropertyName */) { + entityName.parent.kind === 154 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || - entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || + entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38229,10 +38258,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38352,23 +38381,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* StringKeyword */); + return ts.createKeywordTypeNode(143 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* NumberKeyword */); + return ts.createKeywordTypeNode(140 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152 /* BigIntKeyword */); + return ts.createKeywordTypeNode(151 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129 /* BooleanKeyword */); + return ts.createKeywordTypeNode(128 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38409,7 +38438,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38417,7 +38446,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38425,15 +38454,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138 /* NeverKeyword */); + return ts.createKeywordTypeNode(137 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145 /* SymbolKeyword */); + return ts.createKeywordTypeNode(144 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142 /* ObjectKeyword */); + return ts.createKeywordTypeNode(141 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38482,7 +38511,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38509,11 +38538,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728 /* Awaited */) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); - } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38558,7 +38582,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38588,7 +38612,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; + return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38639,12 +38663,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); return signatureNode; } } @@ -38665,7 +38689,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38679,12 +38703,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38779,11 +38803,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38860,7 +38884,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38877,7 +38901,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38886,8 +38910,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38938,7 +38962,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38951,7 +38975,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38965,7 +38989,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -39009,9 +39033,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -39023,7 +39047,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -39042,7 +39066,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192 /* BindingElement */) { + if (clone.kind === 191 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -39183,7 +39207,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39489,8 +39513,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39829,8 +39853,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39945,7 +39969,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -40038,7 +40062,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -40070,7 +40094,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -40080,13 +40104,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -40095,24 +40119,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -40120,11 +40144,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 210 /* BinaryExpression */: - case 195 /* PropertyAccessExpression */: + case 209 /* BinaryExpression */: + case 194 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40345,17 +40369,17 @@ var ts; return result; function visitExistingNodeTreeSymbols(node) { // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 302 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40624,8 +40648,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); - if (node.kind === 248 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); + if (node.kind === 247 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40633,11 +40657,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 /* ModuleBlock */ && + node.parent.kind === 250 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40696,17 +40720,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40723,28 +40747,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 245 /* FunctionDeclaration */: - case 249 /* EnumDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 248 /* EnumDeclaration */: + case 253 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40752,54 +40776,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 163 /* Constructor */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 157 /* Parameter */: - case 251 /* ModuleBlock */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 170 /* TypeReference */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 183 /* ParenthesizedType */: + case 162 /* Constructor */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 156 /* Parameter */: + case 250 /* ModuleBlock */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 169 /* TypeReference */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 182 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: return false; // Type parameters are always visible - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 291 /* SourceFile */: - case 253 /* NamespaceExportDeclaration */: + case 290 /* SourceFile */: + case 252 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return false; default: return false; @@ -40808,10 +40832,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 264 /* ExportSpecifier */) { + else if (node.parent.kind === 263 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40914,12 +40938,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 244 /* VariableDeclarationList */: - case 259 /* ImportSpecifier */: - case 258 /* NamedImports */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 242 /* VariableDeclaration */: + case 243 /* VariableDeclarationList */: + case 258 /* ImportSpecifier */: + case 257 /* NamedImports */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: return false; default: return true; @@ -40952,7 +40976,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -41006,7 +41030,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -41021,23 +41045,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ancestor.initializer; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { + if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -41063,7 +41087,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 190 /* ObjectBindingPattern */) { + if (pattern.kind === 189 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -41136,7 +41160,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -41146,11 +41170,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -41169,7 +41193,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -41183,11 +41207,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157 /* Parameter */) { + if (declaration.kind === 156 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); + if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41402,9 +41426,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 163 /* Constructor */ || - thisContainer.kind === 245 /* FunctionDeclaration */ || - (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 /* Constructor */ || + thisContainer.kind === 244 /* FunctionDeclaration */ || + (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41488,7 +41512,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41512,7 +41536,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 /* ObjectBindingPattern */ + return pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41551,7 +41575,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41609,7 +41633,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260 /* ExportAssignment */) { + if (declaration.kind === 259 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41680,7 +41704,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41714,15 +41738,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41790,9 +41814,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 /* BinaryExpression */ || + else if (declaration.kind === 209 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210 /* BinaryExpression */) { + declaration.parent.kind === 209 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41859,7 +41883,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41958,36 +41982,36 @@ var ts; return undefined; } switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: - case 316 /* JSDocCallbackTag */: - case 187 /* MappedType */: - case 181 /* ConditionalType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 186 /* MappedType */: + case 180 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187 /* MappedType */) { + if (node.kind === 186 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181 /* ConditionalType */) { + else if (node.kind === 180 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41995,7 +42019,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -42005,9 +42029,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 246 /* ClassDeclaration */ || - node.kind === 215 /* ClassExpression */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || + node.kind === 214 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42225,7 +42249,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42261,7 +42285,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */) { + if (declaration.kind === 246 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42349,7 +42373,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210 /* BinaryExpression */) { + else if (expr.kind === 209 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42364,12 +42388,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42383,7 +42407,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42410,7 +42434,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42483,22 +42507,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: - case 188 /* LiteralType */: + case 137 /* NeverKeyword */: + case 187 /* LiteralType */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isThislessType(node.elementType); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42524,7 +42548,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42540,14 +42564,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -43463,8 +43487,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 185 /* TypeOperator */ && - constraintDeclaration.operator === 135 /* KeyOfKeyword */; + return constraintDeclaration.kind === 184 /* TypeOperator */ && + constraintDeclaration.operator === 134 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43689,7 +43713,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432 /* Instantiable */) { + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43725,7 +43749,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43827,10 +43851,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728 /* Awaited */) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43902,7 +43922,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -44190,10 +44210,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 300 /* JSDocOptionalType */ + node.type && node.type.kind === 299 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44227,7 +44247,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44309,7 +44329,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188 /* LiteralType */) { + if (type && type.kind === 187 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -44322,16 +44342,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && + if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 /* Constructor */ ? + var classType = declaration.kind === 162 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44396,11 +44416,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return node.name.kind === 155 /* ComputedPropertyName */ + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return node.name.kind === 154 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44472,7 +44492,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 /* ThisType */ ? + return parameterName.kind === 183 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44515,7 +44535,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163 /* Constructor */) { + if (declaration.kind === 162 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44525,12 +44545,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44620,7 +44640,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; + var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44634,7 +44654,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44668,13 +44688,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182 /* InferType */) { + if (declaration.parent.kind === 181 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 170 /* TypeReference */) { + if (grandParent.kind === 169 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44699,7 +44719,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44724,7 +44744,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44733,7 +44753,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44813,8 +44833,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44858,7 +44878,7 @@ var ts; return errorType; } } - if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44903,9 +44923,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44972,7 +44992,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44998,7 +45018,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -45007,9 +45027,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -45020,7 +45040,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -45133,9 +45153,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return declaration; } } @@ -45256,19 +45276,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { + if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45277,15 +45297,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183 /* ParenthesizedType */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 186 /* IndexedAccessType */: - case 181 /* ConditionalType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 185 /* IndexedAccessType */: + case 180 /* ConditionalType */: + case 184 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } return false; @@ -45294,27 +45314,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; - case 185 /* TypeOperator */: - return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 300 /* JSDocOptionalType */: - case 298 /* JSDocNullableType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 184 /* TypeOperator */: + return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 299 /* JSDocOptionalType */: + case 297 /* JSDocNullableType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 178 /* RestType */: - return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 177 /* RestType */: + return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 178 /* UnionType */: + case 179 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45328,18 +45348,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45444,7 +45464,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 201064448 /* StructuredOrInstantiable */) + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45576,7 +45596,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45930,7 +45950,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45952,24 +45972,20 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ + case 147 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128 /* AwaitedKeyword */: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -46004,13 +46020,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -46021,7 +46037,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -46158,9 +46174,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -46171,7 +46187,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -46181,7 +46197,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -46234,7 +46250,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 197394432 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46306,7 +46322,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46619,7 +46635,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46866,7 +46882,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46902,88 +46918,88 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return anyType; - case 149 /* UnknownKeyword */: + case 148 /* UnknownKeyword */: return unknownType; - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return stringType; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return numberType; - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return bigintType; - case 129 /* BooleanKeyword */: + case 128 /* BooleanKeyword */: return booleanType; - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return neverType; - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getTypeFromTypeReference(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 183 /* ParenthesizedType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 182 /* ParenthesizedType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 178 /* RestType */: + case 177 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 182 /* InferType */: + case 181 /* InferType */: return getTypeFromInferTypeNode(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47191,9 +47207,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 /* QualifiedName */ || - node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 /* QualifiedName */ || + node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -47202,7 +47218,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47211,12 +47227,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -47248,7 +47264,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -47366,7 +47382,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { return getMappedType(type, mapper); @@ -47414,9 +47429,6 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728 /* Awaited */) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432 /* Substitution */) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { @@ -47458,35 +47470,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274 /* JsxAttribute */: { + case 273 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277 /* JsxExpression */: { + case 276 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47505,7 +47517,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47518,7 +47530,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47571,7 +47583,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47621,23 +47633,23 @@ var ts; return true; } switch (node.kind) { - case 277 /* JsxExpression */: - case 201 /* ParenthesizedExpression */: + case 276 /* JsxExpression */: + case 200 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47828,7 +47840,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47837,9 +47849,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47990,11 +48002,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165 /* SetAccessor */: return [3 /*break*/, 2]; - case 164 /* GetAccessor */: return [3 /*break*/, 2]; - case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 164 /* SetAccessor */: return [3 /*break*/, 2]; + case 163 /* GetAccessor */: return [3 /*break*/, 2]; + case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -48071,8 +48083,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && - kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && + kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48333,7 +48345,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48743,7 +48755,7 @@ var ts; result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } } - if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -49108,8 +49120,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -49236,17 +49247,6 @@ var ts; } } } - else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - // An `awaited S` is related to an `awaited T` if `S` is related to `T`: - // - // S <: T ⇒ awaited S <: awaited T - // - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49364,21 +49364,6 @@ var ts; } } } - else if (source.flags & 134217728 /* Awaited */) { - // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the - // constraint of `S`: - // - // S <: C ^ awaited C <: T ⇒ awaited S <: T - // - // For example `awaited Promise` is assignable to `number`. - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -50230,11 +50215,13 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } } variances.push(variance); }; @@ -51007,12 +50994,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210 /* BinaryExpression */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 209 /* BinaryExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157 /* Parameter */: + case 156 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -51027,23 +51014,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -51057,7 +51044,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187 /* MappedType */: + case 186 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -51185,7 +51172,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 197394432 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51481,7 +51468,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 197394432 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51516,9 +51503,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51526,10 +51510,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728 /* Awaited */) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51543,7 +51523,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51655,34 +51635,10 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576 /* Union */) { var nakedTypeVariable = void 0; - for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { - var t = targets_2[_i]; - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - } - // To better support backwards compatibility with the new `awaited` type, we detect a target - // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, - // we infer from source to the type parameter `T`, where each type of source is mapped to extract - // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } var sources = source.flags & 1048576 /* Union */ ? source.types : [source]; var matched_1 = new Array(sources.length); var inferenceCircularity = false; @@ -51690,9 +51646,13 @@ var ts; // track whether inferences were made from that particular type to some target with // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t = targets_2[_i]; + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512 /* MaxValue */; @@ -51730,8 +51690,8 @@ var ts; // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -51745,8 +51705,8 @@ var ts; // we want to infer string for T, not Promise | string. For intersection types // we only infer to single naked type variables. if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1 /* NakedTypeVariable */); } @@ -51903,7 +51863,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; + bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -52073,7 +52033,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -52094,7 +52054,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -52109,11 +52069,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -52124,24 +52084,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201 /* ParenthesizedExpression */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && + (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -52151,11 +52111,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -52184,7 +52144,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -52217,7 +52177,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -52335,7 +52295,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 197394432 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52372,15 +52332,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52397,21 +52357,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return stringType; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return undefinedType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52419,7 +52379,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 /* ObjectBindingPattern */ ? + var type = pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52437,30 +52397,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232 /* ForInStatement */) { + if (node.parent.parent.kind === 231 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.parent.kind === 232 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 /* VariableDeclaration */ ? + return node.kind === 242 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 /* VariableDeclaration */ && node.initializer && + return node.kind === 242 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && + node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52472,13 +52432,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 /* ParenthesizedExpression */ || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 200 /* ParenthesizedExpression */ || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52498,7 +52458,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52660,12 +52620,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 /* CallExpression */ + parent.parent.kind === 196 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 210 /* BinaryExpression */ && + parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52673,8 +52633,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || - declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && + return (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || + declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52687,7 +52647,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, /*diagnostic*/ undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -52713,11 +52673,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52731,7 +52691,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52775,7 +52735,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52850,7 +52810,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52862,7 +52822,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52943,8 +52903,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 195 /* PropertyAccessExpression */ && - reference.kind !== 196 /* ElementAccessExpression */ && + reference.kind !== 194 /* PropertyAccessExpression */ && + reference.kind !== 195 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52969,7 +52929,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -53009,14 +52969,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { + if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -53027,7 +52987,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -53058,7 +53018,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 /* CallExpression */ ? + var expr = node.kind === 196 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -53066,7 +53026,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -53116,7 +53076,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -53124,7 +53084,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -53336,10 +53296,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -53463,7 +53423,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 210 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 209 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53487,7 +53447,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53557,7 +53517,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53771,16 +53731,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53825,9 +53785,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 /* ModuleBlock */ || - node.kind === 291 /* SourceFile */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 250 /* ModuleBlock */ || + node.kind === 290 /* SourceFile */ || + node.kind === 159 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53849,7 +53809,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { symbol.isAssigned = true; } } @@ -53865,7 +53825,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 /* Parameter */ && + declaration.kind === 156 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53879,13 +53839,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 /* PropertyAccessExpression */ || - parent.kind === 197 /* CallExpression */ && parent.expression === node || - parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 194 /* PropertyAccessExpression */ || + parent.kind === 196 /* CallExpression */ && parent.expression === node || + parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53924,7 +53884,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { 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 /* Async */)) { @@ -53945,7 +53905,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 246 /* ClassDeclaration */ + if (declaration.kind === 245 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53957,14 +53917,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215 /* ClassExpression */) { + else if (declaration.kind === 214 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 291 /* SourceFile */) { + while (container.kind !== 290 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -54013,7 +53973,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -54022,8 +53982,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || - flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || + flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -54032,9 +53992,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || - node.parent.kind === 219 /* NonNullExpression */ || - declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || + node.parent.kind === 218 /* NonNullExpression */ || + declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -54069,7 +54029,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -54092,7 +54052,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -54113,7 +54073,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -54132,7 +54092,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 201 /* ParenthesizedExpression */) { + while (current.parent.kind === 200 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -54140,7 +54100,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -54153,7 +54113,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { + if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -54221,37 +54181,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 163 /* Constructor */) { + if (container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 163 /* Constructor */: + case 162 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -54301,7 +54261,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && + (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -54348,7 +54308,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 202 /* FunctionExpression */ && + if (container.kind === 201 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -54358,16 +54318,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 162 /* MethodDeclaration */ && - container.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 161 /* MethodDeclaration */ && + container.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 202 /* FunctionExpression */ && - container.parent.kind === 282 /* PropertyAssignment */ && - container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && + container.parent.kind === 281 /* PropertyAssignment */ && + container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -54375,7 +54335,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 202 /* FunctionExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -54400,7 +54360,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -54414,15 +54374,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 203 /* ArrowFunction */) { + while (container && container.kind === 202 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54435,14 +54395,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); - if (current && current.kind === 155 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); + if (current && current.kind === 154 /* ComputedPropertyName */) { 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 === 194 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54450,7 +54410,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163 /* Constructor */) { + if (!isCallExpression && container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54519,7 +54479,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54533,7 +54493,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (container.parent.kind === 193 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54554,7 +54514,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54569,7 +54529,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 163 /* Constructor */; + return container.kind === 162 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54577,21 +54537,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */; } else { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */ || - container.kind === 160 /* PropertyDeclaration */ || - container.kind === 159 /* PropertySignature */ || - container.kind === 163 /* Constructor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */ || + container.kind === 159 /* PropertyDeclaration */ || + container.kind === 158 /* PropertySignature */ || + container.kind === 162 /* Constructor */; } } } @@ -54599,10 +54559,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 /* MethodDeclaration */ || - func.kind === 164 /* GetAccessor */ || - func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 161 /* MethodDeclaration */ || + func.kind === 163 /* GetAccessor */ || + func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54614,7 +54574,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54641,7 +54601,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282 /* PropertyAssignment */) { + if (literal.parent.kind !== 281 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54655,7 +54615,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54708,9 +54668,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157 /* Parameter */: + case 156 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54719,7 +54679,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54760,9 +54720,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54774,9 +54731,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54847,7 +54801,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199 /* TaggedTemplateExpression */) { + if (template.parent.kind === 198 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -55083,21 +55037,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return true; - case 195 /* PropertyAccessExpression */: - case 201 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 200 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -55122,7 +55076,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -55145,7 +55099,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -55183,58 +55137,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 191 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 203 /* ArrowFunction */: - case 236 /* ReturnStatement */: + case 202 /* ArrowFunction */: + case 235 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 198 /* NewExpression */: + case 197 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193 /* ArrayLiteralExpression */: { + case 192 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); + case 221 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -55391,7 +55345,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; + return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -55405,7 +55359,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55450,8 +55404,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 /* BindingElement */ && !!node.initializer) || - (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 191 /* BindingElement */ && !!node.initializer) || + (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55464,7 +55418,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 /* SpreadElement */ && e.expression; + var spread = e.kind === 213 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55550,7 +55504,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55641,7 +55595,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55655,13 +55609,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 /* PropertyAssignment */ || - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 281 /* PropertyAssignment */ || + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55684,8 +55638,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55711,7 +55665,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284 /* SpreadAssignment */) { + else if (memberDecl.kind === 283 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55740,7 +55694,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55765,7 +55719,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55807,13 +55761,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55909,7 +55863,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55935,7 +55889,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -56365,7 +56319,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56524,7 +56478,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201 /* ParenthesizedExpression */) { + while (node.parent.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56677,7 +56631,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56709,8 +56663,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && - node.parent.kind !== 170 /* TypeReference */ && + else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && + node.parent.kind !== 169 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56722,22 +56676,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return true; - case 282 /* PropertyAssignment */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 284 /* SpreadAssignment */: - case 155 /* ComputedPropertyName */: - case 222 /* TemplateSpan */: - case 277 /* JsxExpression */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 269 /* JsxOpeningElement */: - case 217 /* ExpressionWithTypeArguments */: - case 280 /* HeritageClause */: + case 281 /* PropertyAssignment */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 283 /* SpreadAssignment */: + case 154 /* ComputedPropertyName */: + case 221 /* TemplateSpan */: + case 276 /* JsxExpression */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 268 /* JsxOpeningElement */: + case 216 /* ExpressionWithTypeArguments */: + case 279 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56926,16 +56880,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 189 /* ImportType */: + case 188 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56958,7 +56912,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer.kind === 243 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56987,7 +56941,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 /* ForInStatement */ && + if (node.kind === 231 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -57071,13 +57025,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158 /* Decorator */) { + else if (node.kind !== 157 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -57141,7 +57095,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -57155,9 +57109,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 212 /* TemplateExpression */) { + if (node.template.kind === 211 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -57172,7 +57126,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158 /* Decorator */) { + else if (node.kind === 157 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -57187,7 +57141,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 198 /* NewExpression */); + ts.Debug.assert(node.kind === 197 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -57280,7 +57234,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 158 /* Decorator */) { + if (node.kind !== 157 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -57323,7 +57277,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -57337,7 +57291,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -57347,7 +57301,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 221 /* SyntheticExpression */ ? + return arg.kind === 220 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57502,7 +57456,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57532,7 +57486,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57573,7 +57527,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57581,7 +57535,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57591,17 +57545,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158 /* Decorator */) { + if (node.kind === 157 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57631,30 +57585,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157 /* Parameter */: + case 156 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57668,17 +57622,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 1; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return 2; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 157 /* Parameter */: + case 156 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57803,8 +57757,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 158 /* Decorator */; + var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 157 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57866,7 +57820,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -58382,7 +58336,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 163 /* Constructor */) { + if (!modifiers || declaration.kind !== 162 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58513,16 +58467,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58613,16 +58567,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158 /* Decorator */: + case 157 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58711,7 +58665,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195 /* PropertyAccessExpression */) { + while (parent && parent.kind === 194 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58736,12 +58690,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 198 /* NewExpression */) { + if (node.kind === 197 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 /* Constructor */ && - declaration.kind !== 167 /* ConstructSignature */ && - declaration.kind !== 172 /* ConstructorType */ && + declaration.kind !== 162 /* Constructor */ && + declaration.kind !== 166 /* ConstructSignature */ && + declaration.kind !== 171 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58761,7 +58715,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && + if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58868,9 +58822,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 245 /* FunctionDeclaration */ + ? 244 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 243 /* VariableDeclaration */ + ? 242 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58898,18 +58852,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return true; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58940,8 +58894,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -58959,7 +58919,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163 /* Constructor */) { + else if (container.kind === 162 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -59185,7 +59145,7 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -59195,7 +59155,7 @@ var ts; var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -59226,7 +59186,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -59413,7 +59373,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205 /* TypeOfExpression */) { + if (node.expression.kind === 204 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -59472,11 +59432,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 162 /* MethodDeclaration */: - return func.parent.kind === 194 /* ObjectLiteralExpression */; + case 161 /* MethodDeclaration */: + return func.parent.kind === 193 /* ObjectLiteralExpression */; default: return false; } @@ -59502,7 +59462,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59535,7 +59495,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59559,7 +59519,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59612,7 +59572,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59625,7 +59585,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224 /* Block */) { + if (node.body.kind === 223 /* Block */) { checkSourceElement(node.body); } else { @@ -59715,7 +59675,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163 /* Constructor */)) { + if (!(ctor && ctor.kind === 162 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59740,7 +59700,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257 /* NamespaceImport */; + return !!declaration && declaration.kind === 256 /* NamespaceImport */; } } } @@ -59748,7 +59708,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { // References are combinations of identifiers, parentheses, and property accesses. - var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); + var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 75 /* Identifier */ && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -59766,7 +59726,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59816,7 +59776,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59988,7 +59948,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -60008,7 +59968,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -60021,9 +59981,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 284 /* SpreadAssignment */) { + else if (property.kind === 283 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -60066,8 +60026,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216 /* OmittedExpression */) { - if (element.kind !== 214 /* SpreadElement */) { + if (element.kind !== 215 /* OmittedExpression */) { + if (element.kind !== 213 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -60085,7 +60045,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -60101,7 +60061,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -60117,24 +60077,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194 /* ObjectLiteralExpression */) { + if (target.kind === 193 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193 /* ArrayLiteralExpression */) { + if (target.kind === 192 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 /* SpreadAssignment */ ? + var error = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -60159,36 +60119,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 199 /* TaggedTemplateExpression */: - case 212 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 147 /* UndefinedKeyword */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 205 /* TypeOfExpression */: - case 219 /* NonNullExpression */: - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: + case 146 /* UndefinedKeyword */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 204 /* TypeOfExpression */: + case 218 /* NonNullExpression */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: return true; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -60200,9 +60160,9 @@ var ts; } return false; // Some forms listed here for clarity - case 206 /* VoidExpression */: // Explicit opt-out - case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 205 /* VoidExpression */: // Explicit opt-out + case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -60234,7 +60194,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -60301,7 +60261,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60706,7 +60666,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60755,13 +60715,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; + return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60771,7 +60731,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60800,7 +60760,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60837,7 +60797,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60848,7 +60808,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -61082,11 +61042,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums 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_or_type_query); } @@ -61111,9 +61071,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -61139,78 +61099,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return checkQualifiedName(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checkCallExpression(node, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return checkClassExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return checkAssertion(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return checkNonNullAssertion(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return checkMetaProperty(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkDeleteExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return checkVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return checkAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return undefinedWideningType; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return checkYieldExpression(node); - case 221 /* SyntheticExpression */: + case 220 /* SyntheticExpression */: return node.type; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return checkJsxElement(node, checkMode); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return checkJsxFragment(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -61247,10 +61207,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -61261,13 +61221,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { + if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + if (func.kind === 163 /* GetAccessor */ || func.kind === 164 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -61325,13 +61285,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203 /* ArrowFunction */: - case 166 /* CallSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 171 /* FunctionType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 202 /* ArrowFunction */: + case 165 /* CallSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 170 /* FunctionType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -61349,7 +61309,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { + else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -61358,13 +61318,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || - node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || - node.kind === 167 /* ConstructSignature */) { + else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || + node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || + node.kind === 166 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -61394,10 +61354,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -61427,7 +61387,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { + if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -61439,7 +61399,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163 /* Constructor */) { + if (member.kind === 162 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -61459,16 +61419,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61531,7 +61491,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159 /* PropertySignature */) { + if (member.kind === 158 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61556,7 +61516,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61576,7 +61536,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61584,7 +61544,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61626,7 +61586,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61654,7 +61614,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 /* PropertyDeclaration */ && + return n.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61684,7 +61644,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61709,7 +61669,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61719,7 +61679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61728,7 +61688,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61746,7 +61706,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61794,7 +61754,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61839,7 +61799,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178 /* RestType */) { + if (e.kind === 177 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61848,7 +61808,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177 /* OptionalType */) { + else if (e.kind === 176 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61869,7 +61829,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61920,7 +61880,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61937,9 +61897,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 247 /* InterfaceDeclaration */ && - n.parent.kind !== 246 /* ClassDeclaration */ && - n.parent.kind !== 215 /* ClassExpression */ && + if (n.parent.kind !== 246 /* InterfaceDeclaration */ && + n.parent.kind !== 245 /* ClassDeclaration */ && + n.parent.kind !== 214 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -62035,7 +61995,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && + var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -62075,7 +62035,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -62086,10 +62046,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { + if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -62220,25 +62180,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return 2 /* ExportType */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -62246,17 +62206,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 245 /* FunctionDeclaration */: - case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 244 /* FunctionDeclaration */: + case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -62296,9 +62256,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { @@ -62335,28 +62294,6 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - /** - * Gets or creates an `awaited T` type for a generic type. - * - * The "awaited type" of a generic type cannot be determined until it is instantiated. As - * a result, an `AwaitedType` for the generic type is created that can be instantiated - * or related later. - */ - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728 /* Awaited */); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; - } /** * Determines whether a type has a callable `then` member. */ @@ -62364,32 +62301,6 @@ var ts; var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; } - /** - * Determines whether a type is a generic type whose base constraint could possibly resolve to a different - * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: - * - The type is a generic object type, - * - AND one of the following conditions are met - * - The type has no base constraint, - * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, - * - OR The base constraint has a callable `then` member. - * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a - * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound - * behavior is much more developer friendly. - */ - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152 /* Intersection */) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } /** * Gets the "awaited type" of a type. * @@ -62398,60 +62309,22 @@ var ts; * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a * non-promise type is found. * - * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` - * type. + * This is used to reflect the runtime behavior of the `await` keyword. */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } // For a union, get a union of the awaited types of each constituent. // - // For example: - // - // awaited (number | string) -> number | string - // awaited (number | Promise) -> number | string - // awaited (T | string) -> awaited T | string - // awaited (T | Promise) -> awaited T | string - // awaited (T | Promise) -> awaited T - // awaited (T | U) -> awaited T | awaited U - // return typeAsAwaitable.awaitedTypeOfType = mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } - // We cannot resolve the awaited type for a type variable until it is instantiated. As - // such, we create an `awaited T` type that can either be instantiated or related later. - // - // For example: - // - // T -> awaited T - // - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -62635,24 +62508,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157 /* Parameter */: + case 156 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62699,14 +62572,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; } } @@ -62715,13 +62588,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62767,14 +62640,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62783,23 +62656,23 @@ var ts; } } break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157 /* Parameter */: + case 156 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62862,7 +62735,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62903,7 +62776,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62916,7 +62789,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62945,7 +62818,7 @@ var ts; } } } - var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62987,42 +62860,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291 /* SourceFile */: - case 250 /* ModuleDeclaration */: - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 290 /* SourceFile */: + case 249 /* ModuleDeclaration */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182 /* InferType */: + case 181 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -63042,11 +62915,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162 /* MethodDeclaration */: - case 160 /* PropertyDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 161 /* MethodDeclaration */: + case 159 /* PropertyDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -63057,7 +62930,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -63065,8 +62938,8 @@ var ts; } } break; - case 168 /* IndexSignature */: - case 223 /* SemicolonClassElement */: + case 167 /* IndexSignature */: + case 222 /* SemicolonClassElement */: // Can't be private break; default: @@ -63093,7 +62966,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -63176,7 +63049,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -63194,7 +63067,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -63215,7 +63088,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -63229,22 +63102,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; + return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 224 /* Block */) { + if (node.kind === 223 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -63274,12 +63147,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 /* PropertyDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 162 /* MethodDeclaration */ || - node.kind === 161 /* MethodSignature */ || - node.kind === 164 /* GetAccessor */ || - node.kind === 165 /* SetAccessor */) { + if (node.kind === 159 /* PropertyDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 161 /* MethodDeclaration */ || + node.kind === 160 /* MethodSignature */ || + node.kind === 163 /* GetAccessor */ || + node.kind === 164 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -63288,7 +63161,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -63345,7 +63218,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63360,7 +63233,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63395,7 +63268,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -63407,17 +63280,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 251 /* ModuleBlock */ || - container.kind === 250 /* ModuleDeclaration */ || - container.kind === 291 /* SourceFile */); + (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 250 /* ModuleBlock */ || + container.kind === 249 /* ModuleDeclaration */ || + container.kind === 290 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -63447,18 +63320,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192 /* BindingElement */) { - if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 191 /* BindingElement */) { + if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -63479,19 +63352,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -63528,7 +63401,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -63554,10 +63427,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { + if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -63569,7 +63442,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ + var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63579,8 +63452,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || - (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { + if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || + (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63620,7 +63493,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225 /* EmptyStatement */) { + if (node.thenStatement.kind === 224 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63691,12 +63564,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63730,14 +63603,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63769,7 +63642,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { 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); @@ -63783,7 +63656,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63796,7 +63669,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -64436,7 +64309,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -64458,12 +64331,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165 /* SetAccessor */) { + if (func.kind === 164 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163 /* Constructor */) { + else if (func.kind === 162 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -64471,7 +64344,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -64481,7 +64354,7 @@ var ts; } } } - else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -64510,7 +64383,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -64519,7 +64392,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -64551,7 +64424,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64658,8 +64531,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 /* BinaryExpression */ || - name.kind === 155 /* ComputedPropertyName */ || + (propDeclaration.kind === 209 /* BinaryExpression */ || + name.kind === 154 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64736,7 +64609,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170 /* TypeReference */) { + if (node.kind === 169 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64982,7 +64855,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; + return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -65037,7 +64910,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215 /* ClassExpression */) { + if (derivedClassDecl.kind === 214 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -65059,7 +64932,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -65074,7 +64947,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -65171,7 +65044,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 /* PropertyDeclaration */ && + return node.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -65195,7 +65068,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -65301,7 +65174,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -65311,7 +65184,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -65340,7 +65213,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -65348,14 +65221,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 195 /* PropertyAccessExpression */) { + if (ex.kind === 194 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -65385,8 +65258,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -65422,7 +65295,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 249 /* EnumDeclaration */) { + if (declaration.kind !== 248 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -65450,8 +65323,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 /* ClassDeclaration */ || - (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 /* ClassDeclaration */ || + (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -65514,7 +65387,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -65564,23 +65437,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192 /* BindingElement */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 242 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65591,12 +65464,12 @@ var ts; break; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 245 /* FunctionDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65619,12 +65492,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65644,9 +65517,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65681,14 +65554,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 /* ExportSpecifier */ ? + var message = node.kind === 263 /* ExportSpecifier */ ? 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)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 264 /* ExportSpecifier */ + && node.kind === 263 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65716,7 +65589,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65740,7 +65613,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65785,10 +65658,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65806,14 +65679,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65869,8 +65742,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65984,165 +65857,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return checkTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return checkParameter(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return checkPropertySignature(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return checkSignatureDeclaration(node); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return checkMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return checkConstructorDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return checkAccessorDeclaration(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return checkTypeReferenceNode(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return checkTypePredicate(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return checkTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return checkTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return checkArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return checkTupleType(node); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 178 /* RestType */: + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 177 /* RestType */: return checkSourceElement(node.type); - case 184 /* ThisType */: + case 183 /* ThisType */: return checkThisType(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return checkTypeOperator(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return checkConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return checkInferType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return checkImportType(node); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: - case 305 /* JSDocTypeLiteral */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: + case 304 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 295 /* JSDocTypeExpression */: + case 294 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return checkMappedType(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return checkBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return checkVariableStatement(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return checkExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return checkIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return checkDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return checkWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return checkForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return checkForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkForOfStatement(node); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return checkReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return checkSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return checkThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return checkTryStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return checkBindingElement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return checkClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return checkImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return checkExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return checkExportAssignment(node); - case 225 /* EmptyStatement */: - case 242 /* DebuggerStatement */: + case 224 /* EmptyStatement */: + case 241 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -66237,33 +66110,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: - case 269 /* JsxOpeningElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: + case 268 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 267 /* JsxElement */: + case 266 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -66406,17 +66279,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -66424,8 +66297,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -66434,7 +66307,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -66482,16 +66355,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156 /* TypeParameter */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 155 /* TypeParameter */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return true; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -66499,16 +66372,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 170 /* TypeReference */; + return node.parent.kind === 169 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195 /* PropertyAccessExpression */) { + while (node.parent.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 217 /* ExpressionWithTypeArguments */; + return node.parent.kind === 216 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -66536,13 +66409,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -66568,7 +66441,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66578,7 +66451,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 /* PropertyAccessExpression */ && + name.parent.kind === 194 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66588,7 +66461,7 @@ var ts; } } } - if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66598,7 +66471,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66616,7 +66489,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66632,10 +66505,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318 /* JSDocParameterTag */) { + if (name.parent.kind === 317 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { + if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66652,12 +66525,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { + else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195 /* PropertyAccessExpression */) { + if (name.kind === 194 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66667,17 +66540,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 169 /* TypePredicate */) { + if (name.parent.kind === 168 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66700,8 +66573,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 /* BindingElement */ && - grandParent.kind === 190 /* ObjectBindingPattern */ && + else if (parent.kind === 191 /* BindingElement */ && + grandParent.kind === 189 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66713,8 +66586,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66728,14 +66601,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 184 /* ThisType */: + case 183 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66746,7 +66619,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66768,7 +66641,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66777,7 +66650,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66848,23 +66721,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 233 /* ForOfStatement */) { + if (expr.parent.kind === 232 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 210 /* BinaryExpression */) { + if (expr.parent.kind === 209 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 282 /* PropertyAssignment */) { + if (expr.parent.kind === 281 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66912,7 +66785,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66968,7 +66841,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -67024,7 +66897,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -67052,7 +66925,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -67083,7 +66956,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -67124,19 +66997,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -67145,7 +67018,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -67247,15 +67120,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285 /* EnumMember */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 284 /* EnumMember */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285 /* EnumMember */) { + if (node.kind === 284 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -67496,12 +67369,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; + var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -67517,7 +67390,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -67526,7 +67399,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; + return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -67538,7 +67411,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67589,7 +67462,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67617,12 +67490,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67814,14 +67687,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 /* MethodDeclaration */ && !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 === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { + else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { 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); @@ -67838,17 +67711,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139 /* ReadonlyKeyword */) { - if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { + if (modifier.kind !== 138 /* ReadonlyKeyword */) { + if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 249 /* EnumDeclaration */) { + if (node.kind !== 248 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67868,7 +67741,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67894,10 +67767,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67909,11 +67782,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { + else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67936,19 +67809,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67958,10 +67831,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67974,14 +67847,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246 /* ClassDeclaration */) { - if (node.kind !== 162 /* MethodDeclaration */ && - node.kind !== 160 /* PropertyDeclaration */ && - node.kind !== 164 /* GetAccessor */ && - node.kind !== 165 /* SetAccessor */) { + if (node.kind !== 245 /* ClassDeclaration */) { + if (node.kind !== 161 /* MethodDeclaration */ && + node.kind !== 159 /* PropertyDeclaration */ && + node.kind !== 163 /* GetAccessor */ && + node.kind !== 164 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -68003,7 +67876,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -68011,7 +67884,7 @@ var ts; break; } } - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -68026,13 +67899,13 @@ var ts; } return false; } - else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -68053,37 +67926,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 250 /* ModuleDeclaration */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 157 /* Parameter */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 249 /* ModuleDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 156 /* Parameter */: return false; default: - if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return false; } switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 247 /* InterfaceDeclaration */: - case 226 /* VariableStatement */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 225 /* VariableStatement */: + case 247 /* TypeAliasDeclaration */: return true; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -68096,10 +67969,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -68214,7 +68087,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 !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { + if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -68256,7 +68129,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216 /* OmittedExpression */) { + if (arg.kind === 215 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -68333,20 +68206,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 162 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 161 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -68365,7 +68238,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */) { + if (prop.kind === 283 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -68376,11 +68249,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -68393,7 +68266,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -68408,10 +68281,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -68419,13 +68292,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -68464,7 +68337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276 /* JsxSpreadAttribute */) { + if (attr.kind === 275 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -68474,7 +68347,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -68488,14 +68361,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163 /* Constructor */) { + if (func && func.kind !== 162 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -68506,7 +68379,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -68521,20 +68394,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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); @@ -68559,11 +68432,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165 /* SetAccessor */) { + if (accessor.kind === 164 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68585,21 +68458,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148 /* UniqueKeyword */) { - if (node.type.kind !== 145 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); + if (node.operator === 147 /* UniqueKeyword */) { + if (node.type.kind !== 144 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68611,13 +68484,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68626,9 +68499,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139 /* ReadonlyKeyword */) { - if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); + else if (node.operator === 138 /* ReadonlyKeyword */) { + if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); } } } @@ -68641,8 +68514,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162 /* MethodDeclaration */) { - if (node.parent.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 161 /* MethodDeclaration */) { + if (node.parent.kind === 193 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68670,14 +68543,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68688,11 +68561,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68700,8 +68573,8 @@ var ts; return false; } break; - case 238 /* SwitchStatement */: - if (node.kind === 235 /* BreakStatement */ && !node.label) { + case 237 /* SwitchStatement */: + if (node.kind === 234 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68716,13 +68589,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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 === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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); @@ -68746,12 +68619,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68782,7 +68655,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { + if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68795,7 +68668,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68858,15 +68731,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return false; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68950,7 +68823,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68958,7 +68831,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68987,13 +68860,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 248 /* TypeAliasDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 261 /* ExportDeclaration */ || - node.kind === 260 /* ExportAssignment */ || - node.kind === 253 /* NamespaceExportDeclaration */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 247 /* TypeAliasDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 260 /* ExportDeclaration */ || + node.kind === 259 /* ExportAssignment */ || + node.kind === 252 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -69002,7 +68875,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 === 226 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -69025,7 +68898,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -69047,10 +68920,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -69225,14 +69098,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || + return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -69240,14 +69113,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 256 /* ImportClause */: // For default import - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: // For rename import `x as y` + case 255 /* ImportClause */: // For default import + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 259 /* ImportSpecifier */; + return decl.parent.kind === 258 /* ImportSpecifier */; default: return false; } @@ -69510,7 +69383,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(131 /* DeclareKeyword */)); + result.push(createModifier(130 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -69534,7 +69407,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(139 /* ReadonlyKeyword */)); + result.push(createModifier(138 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -69544,7 +69417,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(154 /* QualifiedName */); + var node = createSynthesizedNode(153 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -69563,7 +69436,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155 /* ComputedPropertyName */); + var node = createSynthesizedNode(154 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69576,7 +69449,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156 /* TypeParameter */); + var node = createSynthesizedNode(155 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69592,7 +69465,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157 /* Parameter */); + var node = createSynthesizedNode(156 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69616,7 +69489,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158 /* Decorator */); + var node = createSynthesizedNode(157 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69629,7 +69502,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertySignature */); + var node = createSynthesizedNode(158 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69649,7 +69522,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160 /* PropertyDeclaration */); + var node = createSynthesizedNode(159 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69673,7 +69546,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69690,7 +69563,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162 /* MethodDeclaration */); + var node = createSynthesizedNode(161 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69750,7 +69623,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163 /* Constructor */); + var node = createSynthesizedNode(162 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69770,7 +69643,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164 /* GetAccessor */); + var node = createSynthesizedNode(163 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69793,7 +69666,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165 /* SetAccessor */); + var node = createSynthesizedNode(164 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69814,7 +69687,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69822,7 +69695,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69830,7 +69703,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168 /* IndexSignature */); + var node = createSynthesizedNode(167 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69874,7 +69747,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169 /* TypePredicate */); + var node = createSynthesizedNode(168 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69894,7 +69767,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170 /* TypeReference */); + var node = createSynthesizedNode(169 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69908,7 +69781,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69916,7 +69789,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69924,7 +69797,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173 /* TypeQuery */); + var node = createSynthesizedNode(172 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69936,7 +69809,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174 /* TypeLiteral */); + var node = createSynthesizedNode(173 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69948,7 +69821,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175 /* ArrayType */); + var node = createSynthesizedNode(174 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69960,7 +69833,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176 /* TupleType */); + var node = createSynthesizedNode(175 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69972,7 +69845,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177 /* OptionalType */); + var node = createSynthesizedNode(176 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69984,7 +69857,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178 /* RestType */); + var node = createSynthesizedNode(177 /* RestType */); node.type = type; return node; } @@ -69996,7 +69869,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -70004,7 +69877,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -70023,7 +69896,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181 /* ConditionalType */); + var node = createSynthesizedNode(180 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -70041,7 +69914,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182 /* InferType */); + var node = createSynthesizedNode(181 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -70053,7 +69926,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189 /* ImportType */); + var node = createSynthesizedNode(188 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -70071,7 +69944,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183 /* ParenthesizedType */); + var node = createSynthesizedNode(182 /* ParenthesizedType */); node.type = type; return node; } @@ -70083,12 +69956,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184 /* ThisType */); + return createSynthesizedNode(183 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; + var node = createSynthesizedNode(184 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -70098,7 +69971,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186 /* IndexedAccessType */); + var node = createSynthesizedNode(185 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -70112,7 +69985,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187 /* MappedType */); + var node = createSynthesizedNode(186 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -70130,7 +70003,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188 /* LiteralType */); + var node = createSynthesizedNode(187 /* LiteralType */); node.literal = literal; return node; } @@ -70143,7 +70016,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ObjectBindingPattern */); + var node = createSynthesizedNode(189 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70155,7 +70028,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191 /* ArrayBindingPattern */); + var node = createSynthesizedNode(190 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70167,7 +70040,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192 /* BindingElement */); + var node = createSynthesizedNode(191 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -70186,7 +70059,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -70200,7 +70073,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -70214,7 +70087,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -70222,10 +70095,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - // Not sure why this cast was necessary: the previous line should already establish that node.name is an identifier - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } // Because we are updating existed propertyAccess we want to inherit its emitFlags // instead of using the default from createPropertyAccess @@ -70236,7 +70107,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70257,7 +70128,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -70274,7 +70145,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70292,7 +70163,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -70311,7 +70182,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70331,7 +70202,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198 /* NewExpression */); + var node = createSynthesizedNode(197 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -70347,7 +70218,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -70370,7 +70241,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200 /* TypeAssertionExpression */); + var node = createSynthesizedNode(199 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -70384,7 +70255,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201 /* ParenthesizedExpression */); + var node = createSynthesizedNode(200 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -70396,7 +70267,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202 /* FunctionExpression */); + var node = createSynthesizedNode(201 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -70420,7 +70291,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203 /* ArrowFunction */); + var node = createSynthesizedNode(202 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -70442,7 +70313,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204 /* DeleteExpression */); + var node = createSynthesizedNode(203 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70454,7 +70325,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205 /* TypeOfExpression */); + var node = createSynthesizedNode(204 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70466,7 +70337,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206 /* VoidExpression */); + var node = createSynthesizedNode(205 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70478,7 +70349,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207 /* AwaitExpression */); + var node = createSynthesizedNode(206 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70490,7 +70361,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -70503,7 +70374,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -70516,7 +70387,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210 /* BinaryExpression */); + var node = createSynthesizedNode(209 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -70533,7 +70404,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211 /* ConditionalExpression */); + var node = createSynthesizedNode(210 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -70553,7 +70424,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212 /* TemplateExpression */); + var node = createSynthesizedNode(211 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70650,7 +70521,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213 /* YieldExpression */); + var node = createSynthesizedNode(212 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70664,7 +70535,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214 /* SpreadElement */); + var node = createSynthesizedNode(213 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70676,7 +70547,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215 /* ClassExpression */); + var node = createSynthesizedNode(214 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70697,11 +70568,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216 /* OmittedExpression */); + return createSynthesizedNode(215 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70715,7 +70586,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218 /* AsExpression */); + var node = createSynthesizedNode(217 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70729,19 +70600,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219 /* NonNullExpression */); + var node = createSynthesizedNode(218 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218 /* NonNullExpression */); + node.flags |= 32 /* OptionalChain */; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220 /* MetaProperty */); + var node = createSynthesizedNode(219 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70755,7 +70643,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222 /* TemplateSpan */); + var node = createSynthesizedNode(221 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70769,12 +70657,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223 /* SemicolonClassElement */); + return createSynthesizedNode(222 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224 /* Block */); + var block = createSynthesizedNode(223 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70788,7 +70676,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226 /* VariableStatement */); + var node = createSynthesizedNode(225 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70803,11 +70691,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225 /* EmptyStatement */); + return createSynthesizedNode(224 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227 /* ExpressionStatement */); + var node = createSynthesizedNode(226 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70823,7 +70711,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228 /* IfStatement */); + var node = createSynthesizedNode(227 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70839,7 +70727,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229 /* DoStatement */); + var node = createSynthesizedNode(228 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70853,7 +70741,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230 /* WhileStatement */); + var node = createSynthesizedNode(229 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70867,7 +70755,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231 /* ForStatement */); + var node = createSynthesizedNode(230 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70885,7 +70773,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForInStatement */); + var node = createSynthesizedNode(231 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70901,7 +70789,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233 /* ForOfStatement */); + var node = createSynthesizedNode(232 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70919,7 +70807,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234 /* ContinueStatement */); + var node = createSynthesizedNode(233 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70931,7 +70819,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235 /* BreakStatement */); + var node = createSynthesizedNode(234 /* BreakStatement */); node.label = asName(label); return node; } @@ -70943,7 +70831,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236 /* ReturnStatement */); + var node = createSynthesizedNode(235 /* ReturnStatement */); node.expression = expression; return node; } @@ -70955,7 +70843,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237 /* WithStatement */); + var node = createSynthesizedNode(236 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70969,7 +70857,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238 /* SwitchStatement */); + var node = createSynthesizedNode(237 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70983,7 +70871,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239 /* LabeledStatement */); + var node = createSynthesizedNode(238 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70997,7 +70885,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240 /* ThrowStatement */); + var node = createSynthesizedNode(239 /* ThrowStatement */); node.expression = expression; return node; } @@ -71009,7 +70897,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241 /* TryStatement */); + var node = createSynthesizedNode(240 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -71025,12 +70913,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242 /* DebuggerStatement */); + return createSynthesizedNode(241 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71048,7 +70936,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71068,7 +70956,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* VariableDeclarationList */); + var node = createSynthesizedNode(243 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -71081,7 +70969,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245 /* FunctionDeclaration */); + var node = createSynthesizedNode(244 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -71107,7 +70995,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* ClassDeclaration */); + var node = createSynthesizedNode(245 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71129,7 +71017,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247 /* InterfaceDeclaration */); + var node = createSynthesizedNode(246 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71151,7 +71039,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71171,7 +71059,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249 /* EnumDeclaration */); + var node = createSynthesizedNode(248 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71190,7 +71078,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(250 /* ModuleDeclaration */); + var node = createSynthesizedNode(249 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -71209,7 +71097,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251 /* ModuleBlock */); + var node = createSynthesizedNode(250 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -71221,7 +71109,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252 /* CaseBlock */); + var node = createSynthesizedNode(251 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -71233,7 +71121,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -71245,7 +71133,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71263,7 +71151,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ImportDeclaration */); + var node = createSynthesizedNode(254 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -71282,7 +71170,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256 /* ImportClause */); + var node = createSynthesizedNode(255 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -71298,13 +71186,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257 /* NamespaceImport */); + var node = createSynthesizedNode(256 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263 /* NamespaceExport */); + var node = createSynthesizedNode(262 /* NamespaceExport */); node.name = name; return node; } @@ -71322,7 +71210,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258 /* NamedImports */); + var node = createSynthesizedNode(257 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -71334,7 +71222,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259 /* ImportSpecifier */); + var node = createSynthesizedNode(258 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -71348,7 +71236,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260 /* ExportAssignment */); + var node = createSynthesizedNode(259 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -71366,7 +71254,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261 /* ExportDeclaration */); + var node = createSynthesizedNode(260 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -71391,7 +71279,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262 /* NamedExports */); + var node = createSynthesizedNode(261 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -71403,7 +71291,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264 /* ExportSpecifier */); + var node = createSynthesizedNode(263 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -71418,7 +71306,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266 /* ExternalModuleReference */); + var node = createSynthesizedNode(265 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -71432,14 +71320,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295 /* JSDocTypeExpression */); + var node = createSynthesizedNode(294 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71447,7 +71335,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71455,14 +71343,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -71472,12 +71360,12 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocClassTag() { - return createJSDocTag(311 /* JSDocClassTag */, "class"); + return createJSDocTag(310 /* JSDocClassTag */, "class"); } ts.createJSDocClassTag = createJSDocClassTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304 /* JSDocComment */); + var node = createSynthesizedNode(303 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -71491,7 +71379,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267 /* JsxElement */); + var node = createSynthesizedNode(266 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -71507,7 +71395,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71523,7 +71411,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269 /* JsxOpeningElement */); + var node = createSynthesizedNode(268 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71539,7 +71427,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270 /* JsxClosingElement */); + var node = createSynthesizedNode(269 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -71551,7 +71439,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271 /* JsxFragment */); + var node = createSynthesizedNode(270 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -71573,11 +71461,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272 /* JsxOpeningFragment */); + return createSynthesizedNode(271 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273 /* JsxClosingFragment */); + return createSynthesizedNode(272 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71589,7 +71477,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274 /* JsxAttribute */); + var node = createSynthesizedNode(273 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71603,7 +71491,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275 /* JsxAttributes */); + var node = createSynthesizedNode(274 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71615,7 +71503,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71627,7 +71515,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277 /* JsxExpression */); + var node = createSynthesizedNode(276 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71641,7 +71529,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278 /* CaseClause */); + var node = createSynthesizedNode(277 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71655,7 +71543,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279 /* DefaultClause */); + var node = createSynthesizedNode(278 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71667,7 +71555,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280 /* HeritageClause */); + var node = createSynthesizedNode(279 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71680,7 +71568,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281 /* CatchClause */); + var node = createSynthesizedNode(280 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71695,7 +71583,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282 /* PropertyAssignment */); + var node = createSynthesizedNode(281 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71710,7 +71598,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71724,7 +71612,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284 /* SpreadAssignment */); + var node = createSynthesizedNode(283 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71737,7 +71625,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285 /* EnumMember */); + var node = createSynthesizedNode(284 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71758,7 +71646,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291 /* SourceFile */); + var updated = createSynthesizedNode(290 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71842,7 +71730,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326 /* NotEmittedStatement */); + var node = createSynthesizedNode(325 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71854,7 +71742,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71866,7 +71754,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71881,7 +71769,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71897,7 +71785,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328 /* CommaListExpression */) { + if (node.kind === 327 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71907,7 +71795,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328 /* CommaListExpression */); + var node = createSynthesizedNode(327 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71920,7 +71808,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71936,7 +71824,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292 /* Bundle */); + var node = ts.createNode(291 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71971,7 +71859,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293 /* UnparsedSource */); + var node = ts.createNode(292 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -72106,10 +71994,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; - case "internal" /* Internal */: return 289 /* UnparsedInternalText */; - case "text" /* Text */: return 288 /* UnparsedText */; + case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; + case "internal" /* Internal */: return 288 /* UnparsedInternalText */; + case "text" /* Text */: return 287 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -72127,14 +72015,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294 /* InputFiles */); + var node = ts.createNode(293 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -72331,7 +72219,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72878,7 +72766,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72897,13 +72785,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72911,7 +72799,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7 /* All */); + var callee = skipOuterExpressions(expression, 15 /* All */); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -72930,7 +72818,7 @@ var ts; } else { switch (callee.kind) { - case 195 /* PropertyAccessExpression */: { + case 194 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72943,7 +72831,7 @@ var ts; } break; } - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -73003,14 +72891,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -73336,7 +73224,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 201 /* ParenthesizedExpression */) { + if (skipped.kind === 200 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -73370,10 +73258,10 @@ 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(210 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -73385,7 +73273,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 213 /* YieldExpression */) { + && operand.kind === 212 /* YieldExpression */) { return false; } return true; @@ -73473,7 +73361,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -73486,7 +73374,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -73521,8 +73409,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: needsParens = true; } } @@ -73538,9 +73426,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return ts.createParen(expression); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -73563,7 +73451,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73601,7 +73489,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73612,29 +73500,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { + if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); + return recreateOuterExpressions(expression, mutableCall, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { + if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73642,9 +73530,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173 /* TypeQuery */: - case 185 /* TypeOperator */: - case 182 /* InferType */: + case 172 /* TypeQuery */: + case 184 /* TypeOperator */: + case 181 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73670,28 +73558,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: node = node.operand; continue; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: node = node.left; continue; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: node = node.condition; continue; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: node = node.tag; continue; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 218 /* AsExpression */: - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: - case 219 /* NonNullExpression */: - case 327 /* PartiallyEmittedExpression */: + case 217 /* AsExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 218 /* NonNullExpression */: + case 326 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73700,71 +73588,61 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 328 /* CommaListExpression */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 327 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; (function (OuterExpressionKinds) { OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + OuterExpressionKinds[OuterExpressionKinds["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds[OuterExpressionKinds["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All"; })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 219 /* NonNullExpression */: - return (kinds & 2 /* Assertions */) !== 0; - case 327 /* PartiallyEmittedExpression */: - return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + return (kinds & 2 /* TypeAssertions */) !== 0; + case 218 /* NonNullExpression */: + return (kinds & 4 /* NonNullAssertions */) !== 0; + case 326 /* PartiallyEmittedExpression */: + return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = ts.skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { + if (kinds === void 0) { kinds = 15 /* All */; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6 /* Assertions */); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73782,7 +73660,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 201 /* ParenthesizedExpression */ + return node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73790,7 +73668,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -73900,10 +73778,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -74022,7 +73900,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -74034,11 +73912,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -74070,12 +73948,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 156 /* Parameter */: + case 191 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 214 /* SpreadElement */: - case 284 /* SpreadAssignment */: + case 213 /* SpreadElement */: + case 283 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -74093,7 +73971,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192 /* BindingElement */: + case 191 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -74108,7 +73986,7 @@ var ts; : propertyName; } break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -74123,7 +74001,7 @@ var ts; : propertyName; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -74146,13 +74024,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -74192,11 +74070,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -74355,289 +74233,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158 /* Decorator */: + case 157 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163 /* Constructor */: + case 162 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176 /* TupleType */: + case 175 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* RestType */: + case 177 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* UnionType */: + case 178 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182 /* InferType */: + case 181 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187 /* MappedType */: + case 186 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 224 /* Block */: + case 223 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForStatement */: + case 230 /* ForStatement */: 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, ts.liftToBlock)); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74680,58 +74558,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { + if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 223 /* SemicolonClassElement */: - case 225 /* EmptyStatement */: - case 216 /* OmittedExpression */: - case 242 /* DebuggerStatement */: - case 326 /* NotEmittedStatement */: + case 222 /* SemicolonClassElement */: + case 224 /* EmptyStatement */: + case 215 /* OmittedExpression */: + case 241 /* DebuggerStatement */: + case 325 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 157 /* Parameter */: + case 156 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158 /* Decorator */: + case 157 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74740,12 +74618,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* Constructor */: + case 162 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74753,7 +74631,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74761,50 +74639,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* NewExpression */: + case 197 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74812,123 +74690,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201 /* ParenthesizedExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218 /* AsExpression */: + case 217 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 224 /* Block */: + case 223 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 230 /* WhileStatement */: - case 237 /* WithStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74937,7 +74815,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74945,143 +74823,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -75154,7 +75032,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75828,7 +75706,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75879,7 +75757,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75892,13 +75770,13 @@ var ts; hasImportDefault = true; } break; - case 254 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + case 253 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75929,13 +75807,13 @@ var ts; } } break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75943,7 +75821,7 @@ var ts; } } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75963,7 +75841,7 @@ var ts; } } break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -76142,7 +76020,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 160 /* PropertyDeclaration */ + return member.kind === 159 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76771,8 +76649,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76798,14 +76676,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76856,16 +76734,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 251 /* ModuleBlock */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 250 /* ModuleBlock */: + case 223 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76877,7 +76755,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76920,10 +76798,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76944,13 +76822,13 @@ var ts; return node; } switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76970,11 +76848,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 261 /* ExportDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 256 /* ImportClause */ || - (node.kind === 254 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 266 /* ExternalModuleReference */)) { + if (node.kind === 260 /* ExportDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 255 /* ImportClause */ || + (node.kind === 253 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 265 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76998,19 +76876,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -77046,62 +76924,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: - case 139 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 174 /* TypeLiteral */: - case 169 /* TypePredicate */: - case 156 /* TypeParameter */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 173 /* TypeLiteral */: + case 168 /* TypePredicate */: + case 155 /* TypeParameter */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 129 /* BooleanKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 128 /* BooleanKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 137 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 145 /* SymbolKeyword */: - case 172 /* ConstructorType */: - case 171 /* FunctionType */: - case 173 /* TypeQuery */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 183 /* ParenthesizedType */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: + case 144 /* SymbolKeyword */: + case 171 /* ConstructorType */: + case 170 /* FunctionType */: + case 172 /* TypeQuery */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 182 /* ParenthesizedType */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 158 /* Decorator */: + case 157 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77111,7 +76989,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77121,35 +76999,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -77159,35 +77037,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77600,12 +77478,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77758,7 +77636,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 160 /* PropertyDeclaration */ + ? member.kind === 159 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77881,10 +77759,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 160 /* PropertyDeclaration */; + return kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 159 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77894,7 +77772,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77905,12 +77783,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; } return false; @@ -77927,15 +77805,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: return serializeTypeNode(node.type); - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77972,7 +77850,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164 /* GetAccessor */) { + if (container && node.kind === 163 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -78018,30 +77896,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return ts.createVoidZero(); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createIdentifier("Function"); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return ts.createIdentifier("Array"); - case 169 /* TypePredicate */: - case 129 /* BooleanKeyword */: + case 168 /* TypePredicate */: + case 128 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return ts.createIdentifier("String"); - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -78052,34 +77930,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return serializeTypeReferenceNode(node); - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return serializeTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 185 /* TypeOperator */: - if (node.operator === 139 /* ReadonlyKeyword */) { + case 184 /* TypeOperator */: + if (node.operator === 138 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 173 /* TypeQuery */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 174 /* TypeLiteral */: + case 172 /* TypeQuery */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 173 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 184 /* ThisType */: - case 189 /* ImportType */: + case 148 /* UnknownKeyword */: + case 183 /* ThisType */: + case 188 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -78092,13 +77970,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -78207,7 +78085,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78527,7 +78405,7 @@ var ts; /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2 /* Assertions */); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */); if (ts.isAssertionExpression(innerExpression)) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; @@ -78767,12 +78645,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 249 /* EnumDeclaration */) { + if (node.kind === 248 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78897,7 +78775,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251 /* ModuleBlock */) { + if (body.kind === 250 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78943,13 +78821,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 251 /* ModuleBlock */) { + if (body.kind !== 250 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78999,7 +78877,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 257 /* NamespaceImport */) { + if (node.kind === 256 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -79247,16 +79125,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(250 /* ModuleDeclaration */); + context.enableEmitNotification(249 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; } /** * Hook for node emit. @@ -79317,9 +79195,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -79357,9 +79235,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 291 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); + if (container && container.kind !== 290 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -79510,40 +79388,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return visitClassLike(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194 /* ObjectLiteralExpression */: - case 193 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -79566,20 +79444,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -80345,31 +80223,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80378,27 +80256,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 224 /* Block */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 237 /* WithStatement */: - case 239 /* LabeledStatement */: + case 223 /* Block */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 236 /* WithStatement */: + case 238 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80603,7 +80481,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203 /* ArrowFunction */; + var isArrowFunction = node.kind === 202 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80694,17 +80572,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -80752,11 +80630,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80788,11 +80666,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80960,64 +80838,64 @@ var ts; return node; } switch (node.kind) { - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitVoidExpression(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -81051,7 +80929,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -81063,7 +80941,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284 /* SpreadAssignment */) { + if (e.kind === 283 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -81072,7 +80950,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -81106,7 +80984,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -81484,17 +81362,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -81542,11 +81420,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -81578,11 +81456,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81680,7 +81558,7 @@ var ts; return node; } switch (node.kind) { - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81712,30 +81590,32 @@ var ts; return node; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -81766,7 +81646,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 /* PropertyAccessExpression */ + expression = node.kind === 194 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81780,10 +81660,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81802,8 +81682,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81813,11 +81693,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 /* PropertyAccessExpression */ + rightExpression = segment.kind === 194 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81915,13 +81795,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81931,13 +81811,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -82012,7 +81892,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277 /* JsxExpression */) { + else if (node.kind === 276 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -82106,7 +81986,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267 /* JsxElement */) { + if (node.kind === 266 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -82412,7 +82292,7 @@ var ts; return node; } switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82625,13 +82505,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 236 /* ReturnStatement */ + && node.kind === 235 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82653,63 +82533,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return visitClassExpression(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82720,28 +82600,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitMetaProperty(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82832,14 +82712,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82850,7 +82730,7 @@ var ts; } } else { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -83246,11 +83126,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 236 /* ReturnStatement */) { + if (statement.kind === 235 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 228 /* IfStatement */) { + else if (statement.kind === 227 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -83258,7 +83138,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 224 /* Block */) { + else if (statement.kind === 223 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -83456,7 +83336,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -83477,22 +83357,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return statements; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -83524,20 +83404,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83739,7 +83619,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83783,7 +83663,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203 /* ArrowFunction */); + ts.Debug.assert(node.kind === 202 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83851,9 +83731,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83872,9 +83752,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -84088,14 +83968,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -84283,7 +84163,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155 /* ComputedPropertyName */) { + if (property.name.kind === 154 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -84404,11 +84284,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -84433,11 +84313,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84836,20 +84716,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84956,7 +84836,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -85448,13 +85328,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(163 /* Constructor */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(203 /* ArrowFunction */); - context.enableEmitNotification(202 /* FunctionExpression */); - context.enableEmitNotification(245 /* FunctionDeclaration */); + context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(202 /* ArrowFunction */); + context.enableEmitNotification(201 /* FunctionExpression */); + context.enableEmitNotification(244 /* FunctionDeclaration */); } } /** @@ -85495,10 +85375,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 242 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -85580,11 +85460,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85592,7 +85472,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85632,15 +85512,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269 /* JsxOpeningElement */); - context.enableEmitNotification(270 /* JsxClosingElement */); - context.enableEmitNotification(268 /* JsxSelfClosingElement */); + context.enableEmitNotification(268 /* JsxOpeningElement */); + context.enableEmitNotification(269 /* JsxClosingElement */); + context.enableEmitNotification(267 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(282 /* PropertyAssignment */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(281 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85659,9 +85539,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85996,13 +85876,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -86015,24 +85895,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return visitBreakStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return visitContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -86053,21 +85933,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitConditionalExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -86080,9 +85960,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -86290,7 +86170,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -86302,7 +86182,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86678,35 +86558,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: return transformAndEmitBlock(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return transformAndEmitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return transformAndEmitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return transformAndEmitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return transformAndEmitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -87136,7 +87016,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -87149,7 +87029,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -88378,11 +88258,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88706,23 +88586,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88749,24 +88629,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -89266,7 +89146,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -89321,10 +89201,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -89537,7 +89417,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89601,10 +89481,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89625,7 +89505,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89700,7 +89580,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89799,12 +89679,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -90028,7 +89908,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -90053,7 +89933,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261 /* ExportDeclaration */) { + if (externalImport.kind !== 260 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -90136,19 +90016,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -90207,13 +90087,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -90393,7 +90273,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -90457,7 +90337,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -90519,10 +90399,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90702,43 +90582,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitDefaultClause(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitTryStatement(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90985,7 +90865,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291 /* SourceFile */; + return container !== undefined && container.kind === 290 /* SourceFile */; } else { return false; @@ -91018,7 +90898,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -91068,7 +90948,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -91104,12 +90984,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -91202,14 +91082,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209 /* PostfixUnaryExpression */) { + if (node.kind === 208 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -91237,7 +91117,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -91276,7 +91156,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291 /* SourceFile */); + context.enableEmitNotification(290 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -91301,12 +91181,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -91437,7 +91317,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91466,7 +91346,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91513,7 +91393,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91522,8 +91402,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || - (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || + (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -91532,7 +91412,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 === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { + else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91557,7 +91437,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91596,26 +91476,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have return types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have return types that cannot be named 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 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91623,7 +91503,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91637,7 +91517,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91662,30 +91542,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 167 /* ConstructSignature */: - case 172 /* ConstructorType */: + case 166 /* ConstructSignature */: + case 171 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91693,7 +91573,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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91706,15 +91586,15 @@ 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 245 /* FunctionDeclaration */: - case 171 /* FunctionType */: + case 244 /* FunctionDeclaration */: + case 170 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91728,39 +91608,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187 /* MappedType */: + case 186 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { 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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { 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 171 /* FunctionType */: - case 245 /* FunctionDeclaration */: + case 170 /* FunctionType */: + case 244 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91775,7 +91655,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 246 /* ClassDeclaration */) { + if (node.parent.parent.kind === 245 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91826,7 +91706,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91985,10 +91865,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -92011,14 +91891,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -92159,7 +92039,7 @@ var ts; return name; } else { - if (name.kind === 191 /* ArrayBindingPattern */) { + if (name.kind === 190 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -92167,7 +92047,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216 /* OmittedExpression */) { + if (elem.kind === 215 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -92205,7 +92085,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 157 /* Parameter */ && + var shouldUseResolverType = node.kind === 156 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -92214,7 +92094,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -92225,12 +92105,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 /* Parameter */ - || node.kind === 160 /* PropertyDeclaration */ - || node.kind === 159 /* PropertySignature */) { + if (node.kind === 156 /* Parameter */ + || node.kind === 159 /* PropertyDeclaration */ + || node.kind === 158 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -92247,20 +92127,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return false; } return false; @@ -92341,7 +92221,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -92361,7 +92241,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -92388,7 +92268,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -92477,7 +92357,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -92498,38 +92378,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217 /* ExpressionWithTypeArguments */: { + case 216 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170 /* TypeReference */: { + case 169 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163 /* Constructor */: { + case 162 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162 /* MethodDeclaration */: { + case 161 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164 /* GetAccessor */: { + case 163 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92538,7 +92418,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 165 /* SetAccessor */: { + case 164 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92546,31 +92426,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161 /* MethodSignature */: { + case 160 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166 /* CallSignature */: { + case 165 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168 /* IndexSignature */: { + case 167 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -92578,13 +92458,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156 /* TypeParameter */: { + case 155 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181 /* ConditionalType */: { + case 180 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92596,13 +92476,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171 /* FunctionType */: { + case 170 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172 /* ConstructorType */: { + case 171 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189 /* ImportType */: { + case 188 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92631,7 +92511,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92641,7 +92521,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261 /* ExportDeclaration */: { + case 260 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92651,7 +92531,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92667,7 +92547,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92692,10 +92572,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92716,14 +92596,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247 /* InterfaceDeclaration */: { + case 246 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245 /* FunctionDeclaration */: { + case 244 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92771,10 +92651,10 @@ var ts; return clean; } } - case 250 /* ModuleDeclaration */: { + case 249 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251 /* ModuleBlock */) { + if (inner && inner.kind === 250 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92817,7 +92697,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 246 /* ClassDeclaration */: { + case 245 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92878,7 +92758,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92898,10 +92778,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 249 /* EnumDeclaration */: { + case 248 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92920,7 +92800,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250 /* ModuleDeclaration */) { + if (input.kind === 249 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92941,7 +92821,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216 /* OmittedExpression */) { + if (e.kind === 215 /* OmittedExpression */) { return; } if (e.name) { @@ -92991,7 +92871,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 291 /* SourceFile */; + var parentIsFile = node.parent.kind === 290 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -93020,7 +92900,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { return true; } return false; @@ -93045,7 +92925,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 /* GetAccessor */ + return accessor.kind === 163 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -93054,52 +92934,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 226 /* VariableStatement */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 225 /* VariableStatement */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 243 /* VariableDeclaration */: - case 156 /* TypeParameter */: - case 217 /* ExpressionWithTypeArguments */: - case 170 /* TypeReference */: - case 181 /* ConditionalType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 189 /* ImportType */: + case 166 /* ConstructSignature */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 242 /* VariableDeclaration */: + case 155 /* TypeParameter */: + case 216 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 180 /* ConditionalType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 188 /* ImportType */: return true; } return false; @@ -93232,7 +93112,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332 /* Count */); + var enabledSyntaxKindFeatures = new Array(331 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93596,7 +93476,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292 /* Bundle */) { + if (sourceFile.kind === 291 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93926,7 +93806,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93949,8 +93829,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93991,7 +93871,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -94102,7 +93982,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -94114,7 +93994,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -94292,9 +94172,9 @@ var ts; break; } switch (node.kind) { - case 291 /* SourceFile */: return printFile(node); - case 292 /* Bundle */: return printBundle(node); - case 293 /* UnparsedSource */: return printUnparsedSource(node); + case 290 /* SourceFile */: return printFile(node); + case 291 /* Bundle */: return printBundle(node); + case 292 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -94550,12 +94430,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94597,15 +94477,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 293 /* UnparsedSource */: - case 287 /* UnparsedPrepend */: + case 292 /* UnparsedSource */: + case 286 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 286 /* UnparsedPrologue */: + case 285 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 290 /* UnparsedSyntheticReference */: + case 289 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94615,260 +94495,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return emitQualifiedName(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return emitTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return emitParameter(node); - case 158 /* Decorator */: + case 157 /* Decorator */: return emitDecorator(node); // Type members - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return emitPropertySignature(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return emitMethodSignature(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return emitConstructor(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return emitAccessorDeclaration(node); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return emitCallSignature(node); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return emitConstructSignature(node); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return emitIndexSignature(node); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return emitTypePredicate(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return emitTypeReference(node); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return emitFunctionType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return emitConstructorType(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return emitTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return emitTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return emitArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return emitTupleType(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return emitOptionalType(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return emitUnionType(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return emitIntersectionType(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return emitConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return emitInferType(node); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return emitParenthesizedType(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return emitThisType(); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return emitTypeOperator(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return emitMappedType(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return emitLiteralType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return emitImportTypeNode(node); - case 296 /* JSDocAllType */: + case 295 /* JSDocAllType */: writePunctuation("*"); return; - case 297 /* JSDocUnknownType */: + case 296 /* JSDocUnknownType */: writePunctuation("?"); return; - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 178 /* RestType */: - case 302 /* JSDocVariadicType */: + case 177 /* RestType */: + case 301 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return emitBindingElement(node); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return emitTemplateSpan(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 224 /* Block */: + case 223 /* Block */: return emitBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return emitVariableStatement(node); - case 225 /* EmptyStatement */: + case 224 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return emitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return emitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return emitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return emitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return emitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return emitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return emitForOfStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return emitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return emitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return emitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return emitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return emitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return emitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return emitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return emitTryStatement(node); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return emitClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return emitModuleBlock(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return emitCaseBlock(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return emitImportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return emitImportClause(node); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return emitNamespaceImport(node); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return emitNamespaceExport(node); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return emitNamedImports(node); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return emitImportSpecifier(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return emitExportDeclaration(node); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return emitNamedExports(node); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return emitExportSpecifier(node); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 270 /* JsxClosingElement */: - case 273 /* JsxClosingFragment */: + case 269 /* JsxClosingElement */: + case 272 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return emitJsxAttribute(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return emitJsxAttributes(node); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return emitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return emitDefaultClause(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return emitHeritageClause(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 309 /* JSDocImplementsTag */: - case 308 /* JSDocAugmentsTag */: + case 308 /* JSDocImplementsTag */: + case 307 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return emitJSDocSignature(node); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 311 /* JSDocClassTag */: - case 307 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 306 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94905,71 +94785,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return emitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return emitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return emitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return emitArrowFunction(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return emitDeleteExpression(node); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return emitVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return emitAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return emitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return emitConditionalExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return emitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return emitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return emitSpreadExpression(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return emitClassExpression(node); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return; - case 218 /* AsExpression */: + case 217 /* AsExpression */: return emitAsExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return emitNonNullExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return emitJsxElement(node); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return emitCommaList(node); } } @@ -95011,7 +94891,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 /* Bundle */ ? node : undefined; + var bundle = node.kind === 291 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -95111,7 +94991,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -95184,7 +95064,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -95246,7 +95126,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -95429,7 +95309,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -95663,7 +95543,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 208 /* PrefixUnaryExpression */ + return operand.kind === 207 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95851,7 +95731,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228 /* IfStatement */) { + if (node.elseStatement.kind === 227 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95914,7 +95794,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95922,7 +95802,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { emit(node); } else { @@ -96218,7 +96098,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250 /* ModuleDeclaration */) { + while (body.kind === 249 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -96263,7 +96143,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -96271,7 +96151,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -96311,7 +96191,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -96323,7 +96203,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -96334,7 +96214,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -96554,7 +96434,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -96588,7 +96468,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96607,7 +96487,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -97427,7 +97307,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -97492,84 +97372,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: ts.forEach(node.statements, generateNames); break; - case 239 /* LabeledStatement */: - case 237 /* WithStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 238 /* LabeledStatement */: + case 236 /* WithStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: generateNames(node.statement); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: generateNames(node.declarationList); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: generateNames(node.importClause); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -97578,12 +97458,12 @@ var ts; if (!node) return; switch (node.kind) { - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97765,23 +97645,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 259 /* ExportAssignment */: return generateNameForExportDefault(); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return generateNameForClassExpression(); - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97829,7 +97709,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97853,7 +97733,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -98112,7 +97992,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -98125,7 +98005,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -100151,22 +100031,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 243 /* VariableDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 242 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -100174,58 +100054,58 @@ var ts; } } switch (node.kind) { - case 256 /* ImportClause */: + case 255 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); + case 249 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218 /* AsExpression */: + case 217 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -100234,29 +100114,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); return "skip"; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -100268,19 +100148,19 @@ var ts; return "skip"; } break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: - case 199 /* TaggedTemplateExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 198 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -100302,8 +100182,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: - case 131 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -107344,37 +107224,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 281 /* CatchClause */: - case 274 /* JsxAttribute */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 280 /* CatchClause */: + case 273 /* JsxAttribute */: return 1 /* Value */; - case 156 /* TypeParameter */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 174 /* TypeLiteral */: + case 155 /* TypeParameter */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 173 /* TypeLiteral */: return 2 /* Type */; - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 285 /* EnumMember */: - case 246 /* ClassDeclaration */: + case 284 /* EnumMember */: + case 245 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -107384,16 +107264,16 @@ var ts; else { return 4 /* Namespace */; } - case 249 /* EnumDeclaration */: - case 258 /* NamedImports */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 248 /* EnumDeclaration */: + case 257 /* NamedImports */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -107401,10 +107281,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { + else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -107436,11 +107316,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -107452,27 +107332,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 154 /* QualifiedName */) { - while (root.parent && root.parent.kind === 154 /* QualifiedName */) { + if (root.parent.kind === 153 /* QualifiedName */) { + while (root.parent && root.parent.kind === 153 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 170 /* TypeReference */ && !isLastClause; + return root.parent.kind === 169 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 195 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { + if (root.parent.kind === 194 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -107483,15 +107363,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return true; } switch (node.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return true; - case 189 /* ImportType */: + case 188 /* ImportType */: return !node.parent.isTypeOf; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -107558,7 +107438,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -107619,22 +107499,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 250 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 249 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return true; - case 188 /* LiteralType */: - return node.parent.parent.kind === 186 /* IndexedAccessType */; + case 187 /* LiteralType */: + return node.parent.parent.kind === 185 /* IndexedAccessType */; default: return false; } @@ -107658,17 +107538,17 @@ var ts; return undefined; } switch (node.kind) { - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return node; } } @@ -107676,54 +107556,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return "class" /* classElement */; - case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 248 /* TypeAliasDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 247 /* TypeAliasDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 249 /* EnumDeclaration */: return "enum" /* enumElement */; - case 243 /* VariableDeclaration */: + case 248 /* EnumDeclaration */: return "enum" /* enumElement */; + case 242 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return "function" /* functionElement */; - case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 166 /* CallSignature */: return "call" /* callSignatureElement */; - case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: + case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 165 /* CallSignature */: return "call" /* callSignatureElement */; + case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: return "alias" /* alias */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -107752,7 +107632,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -107775,7 +107655,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; default: return false; } @@ -107840,42 +107720,42 @@ var ts; return false; } switch (n.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 190 /* ObjectBindingPattern */: - case 174 /* TypeLiteral */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 252 /* CaseBlock */: - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 173 /* TypeLiteral */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 251 /* CaseBlock */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 198 /* NewExpression */: + case 197 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 197 /* CallExpression */: - case 201 /* ParenthesizedExpression */: - case 183 /* ParenthesizedType */: + case 196 /* CallExpression */: + case 200 /* ParenthesizedExpression */: + case 182 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 202 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107885,65 +107765,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 193 /* ArrayLiteralExpression */: - case 191 /* ArrayBindingPattern */: - case 196 /* ElementAccessExpression */: - case 155 /* ComputedPropertyName */: - case 176 /* TupleType */: + case 192 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 195 /* ElementAccessExpression */: + case 154 /* ComputedPropertyName */: + case 175 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 205 /* TypeOfExpression */: - case 204 /* DeleteExpression */: - case 206 /* VoidExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: + case 204 /* TypeOfExpression */: + case 203 /* DeleteExpression */: + case 205 /* VoidExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -108050,11 +107930,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -108149,11 +108029,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -108167,7 +108047,7 @@ var ts; return decl.name; } } - if (node.kind === 146 /* TypeKeyword */) { + if (node.kind === 145 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -108234,12 +108114,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -108264,7 +108144,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -108272,12 +108152,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && + if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && + if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -108314,7 +108194,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -108455,7 +108335,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -108525,17 +108405,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { return true; } return false; @@ -108600,7 +108480,7 @@ var ts; function getPossibleGenericSignatures(called, typeArgumentCount, checker) { var type = checker.getTypeAtLocation(called); if (ts.isOptionalChain(called.parent)) { - type = removeOptionality(type, !!called.parent.questionDotToken, /*isOptionalChain*/ true); + type = removeOptionality(type, ts.isOptionalChainRoot(called.parent), /*isOptionalChain*/ true); } var signatures = ts.isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); return signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; }); @@ -108676,7 +108556,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -108731,16 +108611,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 260 /* ExportAssignment */) + if (node.kind === 259 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { + if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -108785,18 +108665,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 193 /* ArrayLiteralExpression */ || - node.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 192 /* ArrayLiteralExpression */ || + node.kind === 193 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 210 /* BinaryExpression */ && + if (node.parent.kind === 209 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 233 /* ForOfStatement */ && + if (node.parent.kind === 232 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -108804,7 +108684,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -108850,29 +108730,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 152 /* BigIntKeyword */, - 129 /* BooleanKeyword */, + 151 /* BigIntKeyword */, + 128 /* BooleanKeyword */, 91 /* FalseKeyword */, - 135 /* KeyOfKeyword */, - 138 /* NeverKeyword */, + 134 /* KeyOfKeyword */, + 137 /* NeverKeyword */, 100 /* NullKeyword */, - 141 /* NumberKeyword */, - 142 /* ObjectKeyword */, - 139 /* ReadonlyKeyword */, - 144 /* StringKeyword */, - 145 /* SymbolKeyword */, + 140 /* NumberKeyword */, + 141 /* ObjectKeyword */, + 138 /* ReadonlyKeyword */, + 143 /* StringKeyword */, + 144 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 147 /* UndefinedKeyword */, - 148 /* UniqueKeyword */, - 149 /* UnknownKeyword */, + 146 /* UndefinedKeyword */, + 147 /* UniqueKeyword */, + 148 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 146 /* TypeKeyword */; + return node.kind === 145 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108905,7 +108785,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 155 /* ComputedPropertyName */ + return name.kind === 154 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -109065,7 +108945,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -109111,7 +108991,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -109575,15 +109455,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checker.getContextualType(parent); - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 278 /* CaseClause */: + case 277 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -109622,8 +109502,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 199 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: return true; default: return false; @@ -109656,41 +109536,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 166 /* CallSignature */ - || kind === 167 /* ConstructSignature */ - || kind === 168 /* IndexSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */; + return kind === 165 /* CallSignature */ + || kind === 166 /* ConstructSignature */ + || kind === 167 /* IndexSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 244 /* FunctionDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 250 /* ModuleDeclaration */; + return kind === 249 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 226 /* VariableStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 229 /* DoStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 235 /* BreakStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 160 /* PropertyDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 260 /* ExportAssignment */; + return kind === 225 /* VariableStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 228 /* DoStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 234 /* BreakStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 159 /* PropertyDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 259 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -109720,7 +109600,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 229 /* DoStatement */) { + if (node.kind === 228 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -110087,10 +109967,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -110279,9 +110159,9 @@ var ts; return true; } switch (keyword2) { - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - case 130 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + case 129 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -110422,10 +110302,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -110645,18 +110525,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -110807,22 +110687,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -110851,17 +110731,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 243 /* VariableDeclaration */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 157 /* Parameter */ || - parent.kind === 274 /* JsxAttribute */) { + if (parent.kind === 242 /* VariableDeclaration */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 156 /* Parameter */ || + parent.kind === 273 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 210 /* BinaryExpression */ || - parent.kind === 208 /* PrefixUnaryExpression */ || - parent.kind === 209 /* PostfixUnaryExpression */ || - parent.kind === 211 /* ConditionalExpression */) { + if (parent.kind === 209 /* BinaryExpression */ || + parent.kind === 207 /* PrefixUnaryExpression */ || + parent.kind === 208 /* PostfixUnaryExpression */ || + parent.kind === 210 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110874,7 +110754,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110890,32 +110770,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 157 /* Parameter */: + case 156 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -111039,11 +110919,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (parent.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -111051,9 +110931,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 189 /* ImportType */: + case 188 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 179 /* UnionType */: { + case 178 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -111063,7 +110943,7 @@ var ts; default: return undefined; } - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -111080,7 +110960,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -111093,8 +110973,8 @@ var ts; } return undefined; } - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -111103,9 +110983,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 266 /* ExternalModuleReference */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 265 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -112056,11 +111936,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -112070,7 +111950,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -112089,7 +111969,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -112140,11 +112020,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -112196,7 +112076,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -112208,14 +112088,14 @@ var ts; return undefined; } break; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: node = parent.left; break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: node = parent.name; break; - case 189 /* ImportType */: - case 220 /* MetaProperty */: + case 188 /* ImportType */: + case 219 /* MetaProperty */: node = parent; break; default: @@ -112228,7 +112108,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 195 /* PropertyAccessExpression */) { + if (parent && parent.kind === 194 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -112236,38 +112116,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: + case 268 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -112347,11 +112227,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 323 /* JSDocTypedefTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 322 /* JSDocTypedefTag */: return true; default: return false; @@ -112396,7 +112276,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -112443,7 +112323,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -112599,7 +112479,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -112649,10 +112529,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 291 /* SourceFile */: - case 212 /* TemplateExpression */: - case 277 /* JsxExpression */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 211 /* TemplateExpression */: + case 276 /* JsxExpression */: + case 223 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -112698,27 +112578,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 160 /* PropertyDeclaration */ || - parentKind === 159 /* PropertySignature */ || - parentKind === 157 /* Parameter */ || - parentKind === 243 /* VariableDeclaration */ || + return parentKind === 159 /* PropertyDeclaration */ || + parentKind === 158 /* PropertySignature */ || + parentKind === 156 /* Parameter */ || + parentKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 248 /* TypeAliasDeclaration */; + return parentKind === 247 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 218 /* AsExpression */; + return parentKind === 217 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 170 /* TypeReference */ || - parentKind === 200 /* TypeAssertionExpression */; + return parentKind === 169 /* TypeReference */ || + parentKind === 199 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 156 /* TypeParameter */; + return parentKind === 155 /* TypeParameter */; } } return false; @@ -112929,7 +112809,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112939,10 +112819,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 269 /* JsxOpeningElement */; + return location.parent.kind !== 268 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; + if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; } } return false; @@ -112953,40 +112833,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 197 /* CallExpression */ // func( a, | - || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 198 /* NewExpression */ // new C(a, | - || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 196 /* CallExpression */ // func( a, | + || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 197 /* NewExpression */ // new C(a, | + || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 197 /* CallExpression */ // func( | - || containingNodeKind === 163 /* Constructor */ // constructor( | - || containingNodeKind === 198 /* NewExpression */ // new C(a| - || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 196 /* CallExpression */ // func( | + || containingNodeKind === 162 /* Constructor */ // constructor( | + || containingNodeKind === 197 /* NewExpression */ // new C(a| + || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 136 /* ModuleKeyword */: // module | - case 137 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 135 /* ModuleKeyword */: // module | + case 136 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 210 /* BinaryExpression */; // x = a| + return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 209 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -113013,7 +112893,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -113023,7 +112903,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -113034,12 +112914,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -113089,7 +112969,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -113211,11 +113091,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: - case 275 /* JsxAttributes */: - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { + case 194 /* PropertyAccessExpression */: + case 274 /* JsxAttributes */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -113223,7 +113103,7 @@ var ts; } return parent; } - else if (parent.kind === 274 /* JsxAttribute */) { + else if (parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113235,7 +113115,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113245,8 +113125,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 277 /* JsxExpression */ && - parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { + parent.kind === 276 /* JsxExpression */ && + parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113254,7 +113134,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113274,51 +113154,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 243 /* VariableDeclaration */ || + return containingNodeKind === 242 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 226 /* VariableStatement */ || - containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 225 /* VariableStatement */ || + containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 192 /* BindingElement */; // var {x :html| + return containingNodeKind === 191 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 281 /* CatchClause */ || + return containingNodeKind === 280 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | - containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | + containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 157 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 156 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 259 /* ImportSpecifier */ || - containingNodeKind === 264 /* ExportSpecifier */ || - containingNodeKind === 257 /* NamespaceImport */; - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + return containingNodeKind === 258 /* ImportSpecifier */ || + containingNodeKind === 263 /* ExportSpecifier */ || + containingNodeKind === 256 /* NamespaceImport */; + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -113329,7 +113209,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 146 /* TypeKeyword */: // type htm| + case 145 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -113355,7 +113235,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -113377,7 +113257,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -113387,7 +113267,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ + return node.parent.kind === 243 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -113405,13 +113285,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 282 /* PropertyAssignment */ && - m.kind !== 283 /* ShorthandPropertyAssignment */ && - m.kind !== 192 /* BindingElement */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */ && - m.kind !== 284 /* SpreadAssignment */) { + if (m.kind !== 281 /* PropertyAssignment */ && + m.kind !== 282 /* ShorthandPropertyAssignment */ && + m.kind !== 191 /* BindingElement */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */ && + m.kind !== 283 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113482,10 +113362,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 160 /* PropertyDeclaration */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */) { + if (m.kind !== 159 /* PropertyDeclaration */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113526,7 +113406,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 274 /* JsxAttribute */) { + if (attr.kind === 273 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -113576,7 +113456,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -113602,12 +113482,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 131 /* DeclareKeyword */ - || kind === 136 /* ModuleKeyword */ - || kind === 146 /* TypeKeyword */ - || kind === 137 /* NamespaceKeyword */ + || kind === 130 /* DeclareKeyword */ + || kind === 135 /* ModuleKeyword */ + || kind === 145 /* TypeKeyword */ + || kind === 136 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -113629,46 +113509,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 131 /* DeclareKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 134 /* IsKeyword */: - case 135 /* KeyOfKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 138 /* NeverKeyword */: - case 141 /* NumberKeyword */: - case 142 /* ObjectKeyword */: + case 133 /* IsKeyword */: + case 134 /* KeyOfKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 137 /* NeverKeyword */: + case 140 /* NumberKeyword */: + case 141 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: - case 144 /* StringKeyword */: - case 145 /* SymbolKeyword */: - case 146 /* TypeKeyword */: - case 148 /* UniqueKeyword */: - case 149 /* UnknownKeyword */: + case 138 /* ReadonlyKeyword */: + case 143 /* StringKeyword */: + case 144 /* SymbolKeyword */: + case 145 /* TypeKeyword */: + case 147 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 139 /* ReadonlyKeyword */; + return kind === 138 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 130 /* ConstructorKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 129 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -113727,7 +113607,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 325 /* SyntaxList */: + case 324 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113895,11 +113775,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 130 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); + case 129 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113947,7 +113827,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113979,16 +113859,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 238 /* SwitchStatement */: - if (statement.kind === 234 /* ContinueStatement */) { + case 237 /* SwitchStatement */: + if (statement.kind === 233 /* ContinueStatement */) { return false; } // falls through - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -114004,11 +113884,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 224 /* Block */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 223 /* Block */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -114016,14 +113896,14 @@ var ts; else { return container.statements; } - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 173 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -114056,7 +113936,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 229 /* DoStatement */) { + if (loopNode.kind === 228 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -114076,13 +113956,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -114449,10 +114329,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -114465,20 +114345,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -114488,7 +114368,7 @@ var ts; directImports.push(direct); } break; - case 189 /* ImportType */: + case 188 /* ImportType */: directImports.push(direct); break; default: @@ -114505,7 +114385,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -114562,7 +114442,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 254 /* ImportEqualsDeclaration */) { + if (decl.kind === 253 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -114572,7 +114452,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 189 /* ImportType */) { + if (decl.kind === 188 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -114588,7 +114468,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 261 /* ExportDeclaration */) { + if (decl.kind === 260 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -114597,10 +114477,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -114650,7 +114530,7 @@ var ts; } } else { - var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -114679,7 +114559,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 291 /* SourceFile */) { + if (searchSourceFile.kind === 290 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -114727,7 +114607,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -114742,15 +114622,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: { + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -114774,7 +114654,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 195 /* PropertyAccessExpression */) { + if (parent.kind === 194 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114904,13 +114784,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114943,21 +114823,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 291 /* SourceFile */) { + if (parent.kind === 290 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -115059,7 +114939,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -115067,27 +114947,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextNode(node.parent.parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -115148,13 +115028,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -115304,13 +115184,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 215 /* ClassExpression */) { + else if (node.kind === 214 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -115360,7 +115240,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -115371,47 +115251,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 210 /* BinaryExpression */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 209 /* BinaryExpression */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 264 /* ExportSpecifier */: - case 256 /* ImportClause */: // default import - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 247 /* InterfaceDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 274 /* JsxAttribute */: - case 250 /* ModuleDeclaration */: - case 253 /* NamespaceExportDeclaration */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: - case 157 /* Parameter */: - case 283 /* ShorthandPropertyAssignment */: - case 248 /* TypeAliasDeclaration */: - case 156 /* TypeParameter */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 263 /* ExportSpecifier */: + case 255 /* ImportClause */: // default import + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 246 /* InterfaceDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 273 /* JsxAttribute */: + case 249 /* ModuleDeclaration */: + case 252 /* NamespaceExportDeclaration */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: + case 156 /* Parameter */: + case 282 /* ShorthandPropertyAssignment */: + case 247 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: return true; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return !!decl.body; - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 161 /* MethodSignature */: - case 159 /* PropertySignature */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 160 /* MethodSignature */: + case 158 /* PropertySignature */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -115572,10 +115452,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -115604,9 +115484,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 139 /* ReadonlyKeyword */ + return node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 139 /* ReadonlyKeyword */; + && node.parent.operator === 138 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -115617,12 +115497,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -115683,7 +115563,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115923,7 +115803,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115933,7 +115813,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115962,7 +115842,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -116333,15 +116213,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 162 /* MethodDeclaration */) { + if (decl && decl.kind === 161 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -116365,7 +116245,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 163 /* Constructor */); + ts.Debug.assert(decl.kind === 162 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -116395,7 +116275,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -116415,7 +116295,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 224 /* Block */) { + if (body.kind === 223 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -116443,13 +116323,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 193 /* ArrayLiteralExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 192 /* ArrayLiteralExpression */: return true; default: return false; @@ -116502,13 +116382,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -116529,41 +116409,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -116571,19 +116451,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 291 /* SourceFile */: - return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 290 /* SourceFile */: + return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -116666,7 +116546,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -116711,7 +116591,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -117107,55 +116987,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 197 /* CallExpression */: + case 196 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* NewExpression */: + case 197 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 158 /* Decorator */: + case 157 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -117205,22 +117085,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -117517,7 +117397,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -117686,11 +117566,11 @@ var ts; return true; } switch (declaration.kind) { - case 256 /* ImportClause */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: return true; - case 259 /* ImportSpecifier */: - return declaration.parent.kind === 258 /* NamedImports */; + case 258 /* ImportSpecifier */: + return declaration.parent.kind === 257 /* NamedImports */; default: return false; } @@ -117704,7 +117584,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -117777,9 +117657,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return true; default: return false; @@ -117897,11 +117777,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return [declaration]; - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117922,18 +117802,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return withNode(tag.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return withNode(tag.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -118102,23 +117982,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 160 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 159 /* PropertySignature */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 158 /* PropertySignature */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 247 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -118126,14 +118006,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 291 /* SourceFile */: + case 290 /* SourceFile */: return "quit"; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 210 /* BinaryExpression */: { + return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 209 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -118141,7 +118021,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -118157,14 +118037,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return rightHandSide.parameters; - case 215 /* ClassExpression */: { + case 214 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -118226,9 +118106,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -118238,7 +118118,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -118255,7 +118135,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -118462,7 +118342,7 @@ var ts; return; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -118474,21 +118354,21 @@ var ts; } } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 160 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -118500,7 +118380,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -118511,17 +118391,17 @@ var ts; } } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: + case 242 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -118536,7 +118416,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -118544,11 +118424,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -118558,9 +118438,9 @@ var ts; } endNode(); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -118568,20 +118448,20 @@ var ts; } endNode(); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 260 /* ExportAssignment */: - case 264 /* ExportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 168 /* IndexSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 248 /* TypeAliasDeclaration */: + case 259 /* ExportAssignment */: + case 263 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 167 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 247 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -118823,12 +118703,12 @@ var ts; return false; } switch (a.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -118844,7 +118724,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118874,7 +118754,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118883,16 +118763,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118904,18 +118784,18 @@ var ts; } } switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118923,13 +118803,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return "new()"; - case 166 /* CallSignature */: + case 165 /* CallSignature */: return "()"; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "[]"; default: return ""; @@ -118962,19 +118842,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 291 /* SourceFile */: - case 248 /* TypeAliasDeclaration */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 247 /* TypeAliasDeclaration */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: return true; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118984,10 +118864,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: return true; default: return false; @@ -119047,7 +118927,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -119061,13 +118941,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 155 /* ComputedPropertyName */; + return !member.name || member.name.kind === 154 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -119125,9 +119005,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: return true; default: return false; @@ -119635,7 +119515,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -119643,16 +119523,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 229 /* DoStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 281 /* CatchClause */: + case 228 /* DoStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 280 /* CatchClause */: return spanForNode(n.parent); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -119669,29 +119549,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanForNode(n.parent); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 252 /* CaseBlock */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 251 /* CaseBlock */: return spanForNode(n); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return spanForNodeArray(n.statements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return spanForJSXElement(n); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return spanForJSXFragment(n); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -119743,7 +119623,7 @@ var ts; ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -120278,10 +120158,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 131 /* DeclareKeyword */) { + if (token === 130 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 136 /* ModuleKeyword */) { + if (token === 135 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -120317,7 +120197,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -120348,7 +120228,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -120364,7 +120244,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -120394,7 +120274,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -120406,7 +120286,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -120432,7 +120312,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 140 /* RequireKeyword */) { + if (token === 139 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -120593,7 +120473,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -120805,14 +120685,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 156 /* TypeParameter */ || + kind === 155 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120919,7 +120799,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120928,14 +120808,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 269 /* JsxOpeningElement */; + || kind === 268 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 270 /* JsxClosingElement */; + || kind === 269 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -121140,10 +121020,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -121210,17 +121090,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 200 /* ParenthesizedExpression */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -121344,7 +121224,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -121691,11 +121571,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -121712,12 +121592,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -121775,9 +121655,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -121792,7 +121672,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 202 /* FunctionExpression */) { + if (node.kind === 201 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -121800,7 +121680,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 245 /* FunctionDeclaration */) { + if (node.kind === 244 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -121819,7 +121699,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121905,11 +121785,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 269 /* JsxOpeningElement */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121953,7 +121833,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121973,7 +121853,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -122029,29 +121909,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 163 /* Constructor */) { + if (functionDeclaration_1.kind === 162 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -122062,7 +121942,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -122085,7 +121965,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -122106,9 +121986,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -122127,7 +122007,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -122135,21 +122015,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 167 /* ConstructSignature */) { + if (declaration.kind === 166 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 248 /* TypeAliasDeclaration */) { + else if (declaration.kind === 247 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -122161,7 +122041,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 285 /* EnumMember */) { + if (declaration.kind === 284 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -122191,17 +122071,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -122210,13 +122090,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 254 /* ImportEqualsDeclaration */) { + if (declaration.kind === 253 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -122289,10 +122169,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -122410,16 +122290,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 202 /* FunctionExpression */) { + if (declaration.kind === 201 /* FunctionExpression */) { return true; } - if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { + if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { + if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { return false; } } @@ -122719,10 +122599,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 274 /* JsxAttribute */: - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 273 /* JsxAttribute */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122914,7 +122794,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122929,9 +122809,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -123005,7 +122885,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -123029,34 +122909,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 131 /* DeclareKeyword */, + 130 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 132 /* GetKeyword */, + 131 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 136 /* ModuleKeyword */, - 137 /* NamespaceKeyword */, + 135 /* ModuleKeyword */, + 136 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 139 /* ReadonlyKeyword */, - 143 /* SetKeyword */, + 138 /* ReadonlyKeyword */, + 142 /* SetKeyword */, 120 /* StaticKeyword */, - 146 /* TypeKeyword */, - 150 /* FromKeyword */, - 135 /* KeyOfKeyword */, - 133 /* InferKeyword */, + 145 /* TypeKeyword */, + 149 /* FromKeyword */, + 134 /* KeyOfKeyword */, + 132 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -123087,8 +122967,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 132 /* GetKeyword */, - 143 /* SetKeyword */, + 131 /* GetKeyword */, + 142 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -123099,8 +122979,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -123242,51 +123122,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 231 /* ForStatement */; + return context.contextNode.kind === 230 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 211 /* ConditionalExpression */: - case 181 /* ConditionalType */: - case 218 /* AsExpression */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 169 /* TypePredicate */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 210 /* ConditionalExpression */: + case 180 /* ConditionalType */: + case 217 /* AsExpression */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 168 /* TypePredicate */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 192 /* BindingElement */: + case 191 /* BindingElement */: // equals in type X = ... // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: // equal in p = 0 // falls through - case 157 /* Parameter */: - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 233 /* ForOfStatement */: - return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; + case 232 /* ForOfStatement */: + return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; } return false; } @@ -123298,22 +123178,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 160 /* PropertyDeclaration */ || - contextKind === 159 /* PropertySignature */ || - contextKind === 157 /* Parameter */ || - contextKind === 243 /* VariableDeclaration */ || + return contextKind === 159 /* PropertyDeclaration */ || + contextKind === 158 /* PropertySignature */ || + contextKind === 156 /* Parameter */ || + contextKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 211 /* ConditionalExpression */ || - context.contextNode.kind === 181 /* ConditionalType */; + return context.contextNode.kind === 210 /* ConditionalExpression */ || + context.contextNode.kind === 180 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 190 /* ObjectBindingPattern */ || - context.contextNode.kind === 187 /* MappedType */ || + return context.contextNode.kind === 189 /* ObjectBindingPattern */ || + context.contextNode.kind === 186 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -123339,34 +123219,34 @@ var ts; return true; } switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 194 /* ObjectLiteralExpression */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 193 /* ObjectLiteralExpression */: + case 250 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 166 /* CallSignature */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 202 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -123375,40 +123255,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; + return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 174 /* TypeLiteral */: - case 250 /* ModuleDeclaration */: - case 261 /* ExportDeclaration */: - case 262 /* NamedExports */: - case 255 /* ImportDeclaration */: - case 258 /* NamedImports */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 173 /* TypeLiteral */: + case 249 /* ModuleDeclaration */: + case 260 /* ExportDeclaration */: + case 261 /* NamedExports */: + case 254 /* ImportDeclaration */: + case 257 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 281 /* CatchClause */: - case 251 /* ModuleBlock */: - case 238 /* SwitchStatement */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 280 /* CatchClause */: + case 250 /* ModuleBlock */: + case 237 /* SwitchStatement */: return true; - case 224 /* Block */: { + case 223 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { return true; } } @@ -123417,32 +123297,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 237 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 236 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 194 /* ObjectLiteralExpression */; + return context.contextNode.kind === 193 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 197 /* CallExpression */; + return context.contextNode.kind === 196 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 198 /* NewExpression */; + return context.contextNode.kind === 197 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -123457,28 +123337,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 203 /* ArrowFunction */; + return context.contextNode.kind === 202 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 189 /* ImportType */; + return context.contextNode.kind === 188 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; + return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; + return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 274 /* JsxAttribute */; + return context.nextTokenParent.kind === 273 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 274 /* JsxAttribute */; + return context.contextNode.kind === 273 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 268 /* JsxSelfClosingElement */; + return context.contextNode.kind === 267 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -123493,45 +123373,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 250 /* ModuleDeclaration */; + return context.contextNode.kind === 249 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 167 /* ConstructSignature */; + return context.contextNode.kind === 166 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 170 /* TypeReference */: - case 200 /* TypeAssertionExpression */: - case 248 /* TypeAliasDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 199 /* TypeAssertionExpression */: + case 247 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -123542,28 +123422,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 200 /* TypeAssertionExpression */; + return context.contextNode.kind === 199 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 219 /* NonNullExpression */; + return context.contextNode.kind === 218 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 227 /* IfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; default: return false; @@ -123588,12 +123468,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 223 /* SemicolonClassElement */ || + if (nextTokenKind === 222 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || - context.contextNode.kind === 248 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || + context.contextNode.kind === 247 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -123607,9 +123487,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 231 /* ForStatement */ - && context.currentTokenParent.kind !== 225 /* EmptyStatement */ - && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 230 /* ForStatement */ + && context.currentTokenParent.kind !== 224 /* EmptyStatement */ + && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -123617,7 +123497,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 212 /* TemplateExpression */ + && nextTokenKind !== 211 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -123708,12 +123588,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 153 /* LastToken */ + 1; + var mapRowLength = 152 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123901,17 +123781,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 291 /* SourceFile */: - case 224 /* Block */: - case 251 /* ModuleBlock */: + return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 290 /* SourceFile */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -124138,19 +124018,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; - case 164 /* GetAccessor */: return 132 /* GetKeyword */; - case 165 /* SetAccessor */: return 143 /* SetKeyword */; - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; + case 163 /* GetAccessor */: return 131 /* GetKeyword */; + case 164 /* SetAccessor */: return 142 /* SetKeyword */; + case 161 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -124207,15 +124087,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 187 /* MappedType */) { + if (container.kind !== 186 /* MappedType */) { return false; } break; @@ -124318,7 +124198,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -124338,7 +124218,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -124781,12 +124661,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 202 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -124794,8 +124674,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -124803,12 +124683,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 170 /* TypeReference */: + case 169 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124926,7 +124806,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -125080,7 +124960,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -125128,7 +125008,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -125166,40 +125046,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getList(node.typeArguments); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return getList(node.properties); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getList(node.elements); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return getList(node.members); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 198 /* NewExpression */: - case 197 /* CallExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return getList(node.declarations); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return getList(node.elements); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -125222,7 +125102,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -125295,87 +125175,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 227 /* ExpressionStatement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 193 /* ArrayLiteralExpression */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 187 /* MappedType */: - case 176 /* TupleType */: - case 252 /* CaseBlock */: - case 279 /* DefaultClause */: - case 278 /* CaseClause */: - case 201 /* ParenthesizedExpression */: - case 195 /* PropertyAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 226 /* VariableStatement */: - case 260 /* ExportAssignment */: - case 236 /* ReturnStatement */: - case 211 /* ConditionalExpression */: - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: - case 268 /* JsxSelfClosingElement */: - case 277 /* JsxExpression */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 157 /* Parameter */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 183 /* ParenthesizedType */: - case 199 /* TaggedTemplateExpression */: - case 207 /* AwaitExpression */: - case 262 /* NamedExports */: - case 258 /* NamedImports */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 160 /* PropertyDeclaration */: + case 226 /* ExpressionStatement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 192 /* ArrayLiteralExpression */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 186 /* MappedType */: + case 175 /* TupleType */: + case 251 /* CaseBlock */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: + case 200 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 225 /* VariableStatement */: + case 259 /* ExportAssignment */: + case 235 /* ReturnStatement */: + case 210 /* ConditionalExpression */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: + case 267 /* JsxSelfClosingElement */: + case 276 /* JsxExpression */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 156 /* Parameter */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 182 /* ParenthesizedType */: + case 198 /* TaggedTemplateExpression */: + case 206 /* AwaitExpression */: + case 261 /* NamedExports */: + case 257 /* NamedImports */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 159 /* PropertyDeclaration */: return true; - case 243 /* VariableDeclaration */: - case 282 /* PropertyAssignment */: - case 210 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 242 /* VariableDeclaration */: + case 281 /* PropertyAssignment */: + case 209 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 210 /* BinaryExpression */) { + if (parent.kind !== 209 /* BinaryExpression */) { return true; } break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return childKind !== 224 /* Block */; - case 261 /* ExportDeclaration */: - return childKind !== 262 /* NamedExports */; - case 255 /* ImportDeclaration */: - return childKind !== 256 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); - case 267 /* JsxElement */: - return childKind !== 270 /* JsxClosingElement */; - case 271 /* JsxFragment */: - return childKind !== 273 /* JsxClosingFragment */; - case 180 /* IntersectionType */: - case 179 /* UnionType */: - if (childKind === 174 /* TypeLiteral */) { + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return childKind !== 223 /* Block */; + case 260 /* ExportDeclaration */: + return childKind !== 261 /* NamedExports */; + case 254 /* ImportDeclaration */: + return childKind !== 255 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); + case 266 /* JsxElement */: + return childKind !== 269 /* JsxClosingElement */; + case 270 /* JsxFragment */: + return childKind !== 272 /* JsxClosingFragment */; + case 179 /* IntersectionType */: + case 178 /* UnionType */: + if (childKind === 173 /* TypeLiteral */) { return false; } // falls through @@ -125386,11 +125266,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: - return parent.kind !== 224 /* Block */; + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: + return parent.kind !== 223 /* Block */; default: return false; } @@ -125532,7 +125412,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -125718,7 +125598,7 @@ var ts; } } else { - endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -125872,18 +125752,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 157 /* Parameter */: + case 156 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -125892,7 +125772,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 203 /* ArrowFunction */) { + if (node.kind === 202 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125906,14 +125786,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 224 /* Block */) { + if (node.body.kind !== 223 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -126478,14 +126358,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 157 /* Parameter */: { + case 156 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -126500,15 +126380,15 @@ var ts; } break; } - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -126516,13 +126396,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -126531,7 +126411,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -126584,13 +126464,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 281 /* CatchClause */) { + if (parent.kind === 280 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -126601,14 +126481,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -126787,8 +126667,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127019,7 +126899,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -127097,10 +126977,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || - ancestor.parent.kind === 202 /* FunctionExpression */ || - ancestor.parent.kind === 203 /* ArrowFunction */ || - ancestor.parent.kind === 162 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || + ancestor.parent.kind === 201 /* FunctionExpression */ || + ancestor.parent.kind === 202 /* ArrowFunction */ || + ancestor.parent.kind === 161 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -127219,10 +127099,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -127237,7 +127117,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -127286,9 +127166,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 160 /* PropertyDeclaration */ && + if (declaration.kind === 159 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127423,26 +127303,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 243 /* VariableDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 242 /* VariableDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 159 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -127464,7 +127344,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -127504,8 +127384,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -127539,12 +127419,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127599,7 +127479,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127607,7 +127487,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127615,12 +127495,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 203 /* ArrowFunction */: { + case 202 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 224 /* Block */) { + if (arrowFunctionBody.kind === 223 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127648,7 +127528,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -128015,8 +127895,8 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128221,10 +128101,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128277,20 +128157,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 197 /* CallExpression */: { + case 196 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128332,8 +128212,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: { + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128384,16 +128264,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return undefined; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128457,7 +128337,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128465,10 +128345,10 @@ var ts; } } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128486,7 +128366,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128499,7 +128379,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 191 /* ArrayBindingPattern */: { + case 190 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128582,11 +128462,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return parent.propertyName !== node; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129092,11 +128972,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129106,11 +128986,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return declaration.name.text; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129119,10 +128999,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 254 /* ImportEqualsDeclaration */) + if (declaration.kind === 253 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 243 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ + if (declaration.kind === 242 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129130,7 +129010,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129143,7 +129023,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { + if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129186,9 +129066,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129399,7 +129279,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 190 /* ObjectBindingPattern */) { + if (clause.kind === 189 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -130023,7 +129903,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 215 /* ClassExpression */) { + if (classDeclaration.kind === 214 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130071,7 +129951,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 210 /* BinaryExpression */) { + if (token.parent.parent.kind === 209 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130117,7 +129997,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130141,7 +130021,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130704,7 +130584,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +130616,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 133 /* InferKeyword */) + if (token.kind === 132 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +130635,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +130646,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +130662,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 157 /* Parameter */) { + if (decl.kind === 156 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +130673,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +130682,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +130691,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 157 /* Parameter */: - case 156 /* TypeParameter */: + case 156 /* Parameter */: + case 155 /* TypeParameter */: return true; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return true; } } @@ -130865,17 +130745,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: return true; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +130764,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +130813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +130824,8 @@ var ts; return; } // falls through - case 230 /* WhileStatement */: - case 231 /* ForStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +130898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 298 /* JSDocNullableType */) { + if (typeNode.kind === 297 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +130918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +130935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 218 /* AsExpression */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 245 /* FunctionDeclaration */: - case 164 /* GetAccessor */: - case 168 /* IndexSignature */: - case 187 /* MappedType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 200 /* TypeAssertionExpression */: - case 243 /* VariableDeclaration */: + case 217 /* AsExpression */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 163 /* GetAccessor */: + case 167 /* IndexSignature */: + case 186 /* MappedType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 199 /* TypeAssertionExpression */: + case 242 /* VariableDeclaration */: return true; default: return false; @@ -131172,14 +131052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131452,7 +131332,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -131501,14 +131381,14 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 160 /* PropertyDeclaration */) { + if (signature.parent.kind === 159 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -131518,14 +131398,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 318 /* JSDocParameterTag */: { + case 317 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -131550,18 +131430,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 163 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); + case 162 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -131703,24 +131583,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -131728,20 +131608,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -131860,7 +131740,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -131888,7 +131768,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 197 /* CallExpression */) { + if (parent.kind === 196 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -132104,9 +131984,6 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } - else if (genericType.flags & 134217728 /* Awaited */) { - return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); - } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -132123,7 +132000,6 @@ var ts; } var genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */); var usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */); - // allow for multiple overloads of `then`. if (genericSigs.length === 1 && usageSigs.length === 1) { return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); } @@ -132282,8 +132158,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -132297,8 +132173,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: { + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -132327,8 +132203,8 @@ var ts; } break; } - case 161 /* MethodSignature */: - case 162 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 161 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -132373,7 +132249,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -132635,7 +132511,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -132754,7 +132630,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -132930,7 +132806,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -132982,7 +132858,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -133183,16 +133059,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: { + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -133220,12 +133096,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -133233,9 +133109,9 @@ var ts; break; } // falls through - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -133262,18 +133138,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: { + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 256 /* ImportClause */: { + case 255 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -133282,7 +133158,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 257 /* NamespaceImport */) { + else if (namedBindings.kind === 256 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -133303,11 +133179,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 259 /* ImportSpecifier */: { + case 258 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -133320,7 +133196,7 @@ var ts; } break; } - case 264 /* ExportSpecifier */: { + case 263 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -133353,8 +133229,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -133376,7 +133252,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 257 /* NamespaceImport */) { + if (toConvert.kind === 256 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -133723,20 +133599,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 160 /* PropertyDeclaration */) { + if (current.kind === 159 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 157 /* Parameter */) { + else if (current.kind === 156 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 163 /* Constructor */) { + if (ctorOrMethod.kind === 162 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 162 /* MethodDeclaration */) { + else if (current.kind === 161 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -133779,7 +133655,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -133791,13 +133667,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 197 /* CallExpression */) { + if (node.parent.kind === 196 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -133812,8 +133688,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -133825,21 +133701,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 224 /* Block */: - if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { + case 223 /* Block */: + if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 279 /* DefaultClause */: - case 278 /* CaseClause */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -133851,19 +133727,19 @@ var ts; break; } switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: { + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -133872,20 +133748,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -133939,7 +133815,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 157 /* Parameter */) { + if (current.kind === 156 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -133950,7 +133826,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 291 /* SourceFile */) { + if (current.kind === 290 /* SourceFile */) { return scopes; } } @@ -134040,32 +133916,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return "arrow function"; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 246 /* ClassDeclaration */ + return scope.kind === 245 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 251 /* ModuleBlock */ + return scope.kind === 250 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -134285,9 +134161,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } } /** @@ -134316,7 +134192,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -134345,7 +134221,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -134364,7 +134240,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -134508,7 +134384,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -134686,7 +134562,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -135002,30 +134878,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 285 /* EnumMember */: + case 284 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 255 /* ImportDeclaration */ && - parent.kind !== 259 /* ImportSpecifier */; - case 214 /* SpreadElement */: - case 190 /* ObjectBindingPattern */: - case 192 /* BindingElement */: + return parent.kind !== 254 /* ImportDeclaration */ && + parent.kind !== 258 /* ImportSpecifier */; + case 213 /* SpreadElement */: + case 189 /* ObjectBindingPattern */: + case 191 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 192 /* BindingElement */ && - parent.kind !== 259 /* ImportSpecifier */ && - parent.kind !== 264 /* ExportSpecifier */; + return parent.kind !== 191 /* BindingElement */ && + parent.kind !== 258 /* ImportSpecifier */ && + parent.kind !== 263 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 224 /* Block */: - case 291 /* SourceFile */: - case 251 /* ModuleBlock */: - case 278 /* CaseClause */: + case 223 /* Block */: + case 290 /* SourceFile */: + case 250 /* ModuleBlock */: + case 277 /* CaseClause */: return true; default: return false; @@ -135189,7 +135065,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(323 /* JSDocTypedefTag */); + var node = ts.createNode(322 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -135197,10 +135073,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(322 /* JSDocTemplateTag */); + var template = ts.createNode(321 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(156 /* TypeParameter */); + var parameter = ts.createNode(155 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -135311,7 +135187,7 @@ var ts; isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -135454,11 +135330,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return true; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -135546,12 +135422,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? + case 254 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -135582,20 +135458,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -135665,15 +135541,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -135686,7 +135562,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -135698,7 +135574,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 258 /* NamedImports */) { + else if (namedBindings.kind === 257 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -135716,9 +135592,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -135845,13 +135721,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: return true; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -135863,7 +135739,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -135873,9 +135749,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -135884,7 +135760,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -135896,9 +135772,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return name; - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -135955,13 +135831,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -135969,17 +135845,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return cb(statement); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -135991,8 +135867,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -136003,9 +135879,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return d.parent.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -136038,23 +135914,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -136065,18 +135941,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -136346,15 +136222,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -136364,7 +136240,7 @@ var ts; } break; // x["foo"](...) - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -136383,14 +136259,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -136432,11 +136308,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 163 /* Constructor */: + case 162 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -136444,8 +136320,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -136616,7 +136492,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -136624,7 +136500,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -136635,25 +136511,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return [functionDeclaration.name]; - case 163 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { + case 162 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -136904,8 +136780,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); - return child.kind < 154 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); + return child.kind < 153 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -136916,7 +136792,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -136974,7 +136850,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -137288,7 +137164,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 291 /* SourceFile */; + _this.kind = 290 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -137347,10 +137223,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -137370,31 +137246,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 173 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: { + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -137405,12 +137281,12 @@ var ts; } } // falls through - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: addDeclaration(node); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -137423,7 +137299,7 @@ var ts; } } break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -137435,7 +137311,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -137444,7 +137320,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -138063,12 +137939,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -138170,15 +138046,15 @@ var ts; return undefined; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -138195,7 +138071,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -138672,7 +138548,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 266 /* ExternalModuleReference */ || + node.parent.kind === 265 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -138690,13 +138566,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 155 /* ComputedPropertyName */) { + if (node.parent.kind === 154 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && + (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -138738,7 +138614,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 196 /* ElementAccessExpression */ && + node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -138818,114 +138694,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return spanInVariableDeclaration(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return spanInParameterDeclaration(node); - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanInBlock(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInBlock(node.block); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return spanInForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 192 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 191 /* BindingElement */: // span on complete node return textSpan(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 158 /* Decorator */: + case 157 /* Decorator */: return spanInNodeArray(parent.decorators); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -138955,7 +138831,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 153 /* OfKeyword */: + case 152 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -138968,13 +138844,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 214 /* SpreadElement */ || - node.kind === 282 /* PropertyAssignment */ || - node.kind === 283 /* ShorthandPropertyAssignment */) && + node.kind === 213 /* SpreadElement */ || + node.kind === 281 /* PropertyAssignment */ || + node.kind === 282 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -138996,22 +138872,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 158 /* Decorator */: + case 157 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return textSpan(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -139020,21 +138896,21 @@ var ts; } } switch (node.parent.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: { + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -139042,7 +138918,7 @@ var ts; } break; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -139072,7 +138948,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -139084,7 +138960,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 233 /* ForOfStatement */) { + parent.parent.kind === 232 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -139125,7 +139001,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); + (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -139148,26 +139024,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 232 /* ForInStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 231 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -139192,21 +139068,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 192 /* BindingElement */) { + if (bindingPattern.parent.kind === 191 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); - var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); + var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -139214,18 +139090,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -139233,25 +139109,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 249 /* EnumDeclaration */: - case 246 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -139259,7 +139135,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139275,7 +139151,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139290,12 +139166,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 197 /* CallExpression */ || - node.parent.kind === 198 /* NewExpression */) { + if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 196 /* CallExpression */ || + node.parent.kind === 197 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 201 /* ParenthesizedExpression */) { + if (node.parent.kind === 200 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -139304,21 +139180,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 201 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 200 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -139328,20 +139204,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ || - node.parent.kind === 157 /* Parameter */) { + node.parent.kind === 281 /* PropertyAssignment */ || + node.parent.kind === 156 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 200 /* TypeAssertionExpression */) { + if (node.parent.kind === 199 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 229 /* DoStatement */) { + if (node.parent.kind === 228 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -139349,7 +139225,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.kind === 232 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 3e4b517575c..d26c3d90515 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -71,7 +71,7 @@ declare namespace ts { end: number; } export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.AwaitedKeyword | SyntaxKind.OfKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export enum SyntaxKind { Unknown = 0, @@ -203,211 +203,210 @@ declare namespace ts { AnyKeyword = 125, AsyncKeyword = 126, AwaitKeyword = 127, - AwaitedKeyword = 128, - BooleanKeyword = 129, - ConstructorKeyword = 130, - DeclareKeyword = 131, - GetKeyword = 132, - InferKeyword = 133, - IsKeyword = 134, - KeyOfKeyword = 135, - ModuleKeyword = 136, - NamespaceKeyword = 137, - NeverKeyword = 138, - ReadonlyKeyword = 139, - RequireKeyword = 140, - NumberKeyword = 141, - ObjectKeyword = 142, - SetKeyword = 143, - StringKeyword = 144, - SymbolKeyword = 145, - TypeKeyword = 146, - UndefinedKeyword = 147, - UniqueKeyword = 148, - UnknownKeyword = 149, - FromKeyword = 150, - GlobalKeyword = 151, - BigIntKeyword = 152, - OfKeyword = 153, - QualifiedName = 154, - ComputedPropertyName = 155, - TypeParameter = 156, - Parameter = 157, - Decorator = 158, - PropertySignature = 159, - PropertyDeclaration = 160, - MethodSignature = 161, - MethodDeclaration = 162, - Constructor = 163, - GetAccessor = 164, - SetAccessor = 165, - CallSignature = 166, - ConstructSignature = 167, - IndexSignature = 168, - TypePredicate = 169, - TypeReference = 170, - FunctionType = 171, - ConstructorType = 172, - TypeQuery = 173, - TypeLiteral = 174, - ArrayType = 175, - TupleType = 176, - OptionalType = 177, - RestType = 178, - UnionType = 179, - IntersectionType = 180, - ConditionalType = 181, - InferType = 182, - ParenthesizedType = 183, - ThisType = 184, - TypeOperator = 185, - IndexedAccessType = 186, - MappedType = 187, - LiteralType = 188, - ImportType = 189, - ObjectBindingPattern = 190, - ArrayBindingPattern = 191, - BindingElement = 192, - ArrayLiteralExpression = 193, - ObjectLiteralExpression = 194, - PropertyAccessExpression = 195, - ElementAccessExpression = 196, - CallExpression = 197, - NewExpression = 198, - TaggedTemplateExpression = 199, - TypeAssertionExpression = 200, - ParenthesizedExpression = 201, - FunctionExpression = 202, - ArrowFunction = 203, - DeleteExpression = 204, - TypeOfExpression = 205, - VoidExpression = 206, - AwaitExpression = 207, - PrefixUnaryExpression = 208, - PostfixUnaryExpression = 209, - BinaryExpression = 210, - ConditionalExpression = 211, - TemplateExpression = 212, - YieldExpression = 213, - SpreadElement = 214, - ClassExpression = 215, - OmittedExpression = 216, - ExpressionWithTypeArguments = 217, - AsExpression = 218, - NonNullExpression = 219, - MetaProperty = 220, - SyntheticExpression = 221, - TemplateSpan = 222, - SemicolonClassElement = 223, - Block = 224, - EmptyStatement = 225, - VariableStatement = 226, - ExpressionStatement = 227, - IfStatement = 228, - DoStatement = 229, - WhileStatement = 230, - ForStatement = 231, - ForInStatement = 232, - ForOfStatement = 233, - ContinueStatement = 234, - BreakStatement = 235, - ReturnStatement = 236, - WithStatement = 237, - SwitchStatement = 238, - LabeledStatement = 239, - ThrowStatement = 240, - TryStatement = 241, - DebuggerStatement = 242, - VariableDeclaration = 243, - VariableDeclarationList = 244, - FunctionDeclaration = 245, - ClassDeclaration = 246, - InterfaceDeclaration = 247, - TypeAliasDeclaration = 248, - EnumDeclaration = 249, - ModuleDeclaration = 250, - ModuleBlock = 251, - CaseBlock = 252, - NamespaceExportDeclaration = 253, - ImportEqualsDeclaration = 254, - ImportDeclaration = 255, - ImportClause = 256, - NamespaceImport = 257, - NamedImports = 258, - ImportSpecifier = 259, - ExportAssignment = 260, - ExportDeclaration = 261, - NamedExports = 262, - NamespaceExport = 263, - ExportSpecifier = 264, - MissingDeclaration = 265, - ExternalModuleReference = 266, - JsxElement = 267, - JsxSelfClosingElement = 268, - JsxOpeningElement = 269, - JsxClosingElement = 270, - JsxFragment = 271, - JsxOpeningFragment = 272, - JsxClosingFragment = 273, - JsxAttribute = 274, - JsxAttributes = 275, - JsxSpreadAttribute = 276, - JsxExpression = 277, - CaseClause = 278, - DefaultClause = 279, - HeritageClause = 280, - CatchClause = 281, - PropertyAssignment = 282, - ShorthandPropertyAssignment = 283, - SpreadAssignment = 284, - EnumMember = 285, - UnparsedPrologue = 286, - UnparsedPrepend = 287, - UnparsedText = 288, - UnparsedInternalText = 289, - UnparsedSyntheticReference = 290, - SourceFile = 291, - Bundle = 292, - UnparsedSource = 293, - InputFiles = 294, - JSDocTypeExpression = 295, - JSDocAllType = 296, - JSDocUnknownType = 297, - JSDocNullableType = 298, - JSDocNonNullableType = 299, - JSDocOptionalType = 300, - JSDocFunctionType = 301, - JSDocVariadicType = 302, - JSDocNamepathType = 303, - JSDocComment = 304, - JSDocTypeLiteral = 305, - JSDocSignature = 306, - JSDocTag = 307, - JSDocAugmentsTag = 308, - JSDocImplementsTag = 309, - JSDocAuthorTag = 310, - JSDocClassTag = 311, - JSDocPublicTag = 312, - JSDocPrivateTag = 313, - JSDocProtectedTag = 314, - JSDocReadonlyTag = 315, - JSDocCallbackTag = 316, - JSDocEnumTag = 317, - JSDocParameterTag = 318, - JSDocReturnTag = 319, - JSDocThisTag = 320, - JSDocTypeTag = 321, - JSDocTemplateTag = 322, - JSDocTypedefTag = 323, - JSDocPropertyTag = 324, - SyntaxList = 325, - NotEmittedStatement = 326, - PartiallyEmittedExpression = 327, - CommaListExpression = 328, - MergeDeclarationMarker = 329, - EndOfDeclarationMarker = 330, - SyntheticReferenceExpression = 331, - Count = 332, + BooleanKeyword = 128, + ConstructorKeyword = 129, + DeclareKeyword = 130, + GetKeyword = 131, + InferKeyword = 132, + IsKeyword = 133, + KeyOfKeyword = 134, + ModuleKeyword = 135, + NamespaceKeyword = 136, + NeverKeyword = 137, + ReadonlyKeyword = 138, + RequireKeyword = 139, + NumberKeyword = 140, + ObjectKeyword = 141, + SetKeyword = 142, + StringKeyword = 143, + SymbolKeyword = 144, + TypeKeyword = 145, + UndefinedKeyword = 146, + UniqueKeyword = 147, + UnknownKeyword = 148, + FromKeyword = 149, + GlobalKeyword = 150, + BigIntKeyword = 151, + OfKeyword = 152, + QualifiedName = 153, + ComputedPropertyName = 154, + TypeParameter = 155, + Parameter = 156, + Decorator = 157, + PropertySignature = 158, + PropertyDeclaration = 159, + MethodSignature = 160, + MethodDeclaration = 161, + Constructor = 162, + GetAccessor = 163, + SetAccessor = 164, + CallSignature = 165, + ConstructSignature = 166, + IndexSignature = 167, + TypePredicate = 168, + TypeReference = 169, + FunctionType = 170, + ConstructorType = 171, + TypeQuery = 172, + TypeLiteral = 173, + ArrayType = 174, + TupleType = 175, + OptionalType = 176, + RestType = 177, + UnionType = 178, + IntersectionType = 179, + ConditionalType = 180, + InferType = 181, + ParenthesizedType = 182, + ThisType = 183, + TypeOperator = 184, + IndexedAccessType = 185, + MappedType = 186, + LiteralType = 187, + ImportType = 188, + ObjectBindingPattern = 189, + ArrayBindingPattern = 190, + BindingElement = 191, + ArrayLiteralExpression = 192, + ObjectLiteralExpression = 193, + PropertyAccessExpression = 194, + ElementAccessExpression = 195, + CallExpression = 196, + NewExpression = 197, + TaggedTemplateExpression = 198, + TypeAssertionExpression = 199, + ParenthesizedExpression = 200, + FunctionExpression = 201, + ArrowFunction = 202, + DeleteExpression = 203, + TypeOfExpression = 204, + VoidExpression = 205, + AwaitExpression = 206, + PrefixUnaryExpression = 207, + PostfixUnaryExpression = 208, + BinaryExpression = 209, + ConditionalExpression = 210, + TemplateExpression = 211, + YieldExpression = 212, + SpreadElement = 213, + ClassExpression = 214, + OmittedExpression = 215, + ExpressionWithTypeArguments = 216, + AsExpression = 217, + NonNullExpression = 218, + MetaProperty = 219, + SyntheticExpression = 220, + TemplateSpan = 221, + SemicolonClassElement = 222, + Block = 223, + EmptyStatement = 224, + VariableStatement = 225, + ExpressionStatement = 226, + IfStatement = 227, + DoStatement = 228, + WhileStatement = 229, + ForStatement = 230, + ForInStatement = 231, + ForOfStatement = 232, + ContinueStatement = 233, + BreakStatement = 234, + ReturnStatement = 235, + WithStatement = 236, + SwitchStatement = 237, + LabeledStatement = 238, + ThrowStatement = 239, + TryStatement = 240, + DebuggerStatement = 241, + VariableDeclaration = 242, + VariableDeclarationList = 243, + FunctionDeclaration = 244, + ClassDeclaration = 245, + InterfaceDeclaration = 246, + TypeAliasDeclaration = 247, + EnumDeclaration = 248, + ModuleDeclaration = 249, + ModuleBlock = 250, + CaseBlock = 251, + NamespaceExportDeclaration = 252, + ImportEqualsDeclaration = 253, + ImportDeclaration = 254, + ImportClause = 255, + NamespaceImport = 256, + NamedImports = 257, + ImportSpecifier = 258, + ExportAssignment = 259, + ExportDeclaration = 260, + NamedExports = 261, + NamespaceExport = 262, + ExportSpecifier = 263, + MissingDeclaration = 264, + ExternalModuleReference = 265, + JsxElement = 266, + JsxSelfClosingElement = 267, + JsxOpeningElement = 268, + JsxClosingElement = 269, + JsxFragment = 270, + JsxOpeningFragment = 271, + JsxClosingFragment = 272, + JsxAttribute = 273, + JsxAttributes = 274, + JsxSpreadAttribute = 275, + JsxExpression = 276, + CaseClause = 277, + DefaultClause = 278, + HeritageClause = 279, + CatchClause = 280, + PropertyAssignment = 281, + ShorthandPropertyAssignment = 282, + SpreadAssignment = 283, + EnumMember = 284, + UnparsedPrologue = 285, + UnparsedPrepend = 286, + UnparsedText = 287, + UnparsedInternalText = 288, + UnparsedSyntheticReference = 289, + SourceFile = 290, + Bundle = 291, + UnparsedSource = 292, + InputFiles = 293, + JSDocTypeExpression = 294, + JSDocAllType = 295, + JSDocUnknownType = 296, + JSDocNullableType = 297, + JSDocNonNullableType = 298, + JSDocOptionalType = 299, + JSDocFunctionType = 300, + JSDocVariadicType = 301, + JSDocNamepathType = 302, + JSDocComment = 303, + JSDocTypeLiteral = 304, + JSDocSignature = 305, + JSDocTag = 306, + JSDocAugmentsTag = 307, + JSDocImplementsTag = 308, + JSDocAuthorTag = 309, + JSDocClassTag = 310, + JSDocPublicTag = 311, + JSDocPrivateTag = 312, + JSDocProtectedTag = 313, + JSDocReadonlyTag = 314, + JSDocCallbackTag = 315, + JSDocEnumTag = 316, + JSDocParameterTag = 317, + JSDocReturnTag = 318, + JSDocThisTag = 319, + JSDocTypeTag = 320, + JSDocTemplateTag = 321, + JSDocTypedefTag = 322, + JSDocPropertyTag = 323, + SyntaxList = 324, + NotEmittedStatement = 325, + PartiallyEmittedExpression = 326, + CommaListExpression = 327, + MergeDeclarationMarker = 328, + EndOfDeclarationMarker = 329, + SyntheticReferenceExpression = 330, + Count = 331, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -415,15 +414,15 @@ declare namespace ts { FirstReservedWord = 77, LastReservedWord = 112, FirstKeyword = 77, - LastKeyword = 153, + LastKeyword = 152, FirstFutureReservedWord = 113, LastFutureReservedWord = 121, - FirstTypeNode = 169, - LastTypeNode = 189, + FirstTypeNode = 168, + LastTypeNode = 188, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, - LastToken = 153, + LastToken = 152, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -432,13 +431,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 226, - LastStatement = 242, - FirstNode = 154, - FirstJSDocNode = 295, - LastJSDocNode = 324, - FirstJSDocTagNode = 307, - LastJSDocTagNode = 324, + FirstStatement = 225, + LastStatement = 241, + FirstNode = 153, + FirstJSDocNode = 294, + LastJSDocNode = 323, + FirstJSDocTagNode = 306, + LastJSDocTagNode = 323, } export enum NodeFlags { None = 0, @@ -845,7 +844,7 @@ declare namespace ts { } export interface TypeOperatorNode extends TypeNode { kind: SyntaxKind.TypeOperator; - operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword; + operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; type: TypeNode; } export interface IndexedAccessTypeNode extends TypeNode { @@ -1138,7 +1137,7 @@ declare namespace ts { export interface CallChain extends CallExpression { _optionalChainBrand: any; } - export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain; + export type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; export interface SuperCall extends CallExpression { expression: SuperExpression; } @@ -1178,6 +1177,9 @@ declare namespace ts { kind: SyntaxKind.NonNullExpression; expression: Expression; } + export interface NonNullChain extends NonNullExpression { + _optionalChainBrand: any; + } export interface MetaProperty extends PrimaryExpression { kind: SyntaxKind.MetaProperty; keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; @@ -2361,7 +2363,6 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - Awaited = 134217728, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, @@ -2376,11 +2377,11 @@ declare namespace ts { UnionOrIntersection = 3145728, StructuredType = 3670016, TypeVariable = 8650752, - InstantiableNonPrimitive = 193200128, + InstantiableNonPrimitive = 58982400, InstantiablePrimitive = 4194304, - Instantiable = 197394432, - StructuredOrInstantiable = 201064448, - Narrowable = 268188671, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, NotUnionOrUnit = 67637251, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; @@ -2528,9 +2529,6 @@ declare namespace ts { baseType: Type; substitute: Type; } - export interface AwaitedType extends InstantiableType { - awaitedType: Type; - } export enum SignatureKind { Call = 0, Construct = 1 @@ -3634,7 +3632,7 @@ declare namespace ts { function isElementAccessChain(node: Node): node is ElementAccessChain; function isCallExpression(node: Node): node is CallExpression; function isCallChain(node: Node): node is CallChain; - function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain; + function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; function isNullishCoalesce(node: Node): boolean; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; @@ -3661,6 +3659,7 @@ declare namespace ts { function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; function isAsExpression(node: Node): node is AsExpression; function isNonNullExpression(node: Node): node is NonNullExpression; + function isNonNullChain(node: Node): node is NonNullChain; function isMetaProperty(node: Node): node is MetaProperty; function isTemplateSpan(node: Node): node is TemplateSpan; function isSemicolonClassElement(node: Node): node is SemicolonClassElement; @@ -4071,7 +4070,7 @@ declare namespace ts { function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; - function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.AwaitedKeyword, type: TypeNode): TypeOperatorNode; + function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; @@ -4152,6 +4151,8 @@ declare namespace ts { function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; function createNonNullExpression(expression: Expression): NonNullExpression; function updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; + function createNonNullChain(expression: Expression): NonNullChain; + function updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; function createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; function updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 6955fbea9aa..3b1daf4f2f0 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -3203,234 +3203,233 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3439,15 +3438,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3456,15 +3455,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4010,7 +4009,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4039,10 +4037,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -4051,10 +4049,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -8208,8 +8206,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 152 /* BigIntKeyword */, - boolean: 129 /* BooleanKeyword */, + bigint: 151 /* BigIntKeyword */, + boolean: 128 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8217,9 +8215,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 130 /* ConstructorKeyword */, + _a["" + "constructor"] = 129 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 131 /* DeclareKeyword */, + _a.declare = 130 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8230,49 +8228,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 150 /* FromKeyword */, + _a.from = 149 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 132 /* GetKeyword */, + _a.get = 131 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 133 /* InferKeyword */, + _a.infer = 132 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 134 /* IsKeyword */, - _a.keyof = 135 /* KeyOfKeyword */, + _a.is = 133 /* IsKeyword */, + _a.keyof = 134 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 136 /* ModuleKeyword */, - _a.namespace = 137 /* NamespaceKeyword */, - _a.never = 138 /* NeverKeyword */, + _a.module = 135 /* ModuleKeyword */, + _a.namespace = 136 /* NamespaceKeyword */, + _a.never = 137 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 141 /* NumberKeyword */, - _a.object = 142 /* ObjectKeyword */, + _a.number = 140 /* NumberKeyword */, + _a.object = 141 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 139 /* ReadonlyKeyword */, - _a.require = 140 /* RequireKeyword */, - _a.global = 151 /* GlobalKeyword */, + _a.readonly = 138 /* ReadonlyKeyword */, + _a.require = 139 /* RequireKeyword */, + _a.global = 150 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 143 /* SetKeyword */, + _a.set = 142 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 144 /* StringKeyword */, + _a.string = 143 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 145 /* SymbolKeyword */, + _a.symbol = 144 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 146 /* TypeKeyword */, + _a.type = 145 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 147 /* UndefinedKeyword */, - _a.unique = 148 /* UniqueKeyword */, - _a.unknown = 149 /* UnknownKeyword */, + _a.undefined = 146 /* UndefinedKeyword */, + _a.unique = 147 /* UniqueKeyword */, + _a.unknown = 148 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8280,8 +8278,7 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.awaited = 128 /* AwaitedKeyword */, - _a.of = 153 /* OfKeyword */, + _a.of = 152 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -10635,9 +10632,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156 /* TypeParameter */) { + if (d && d.kind === 155 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { return current; } } @@ -10645,7 +10642,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10675,14 +10672,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243 /* VariableDeclaration */) { + if (node.kind === 242 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 244 /* VariableDeclarationList */) { + if (node && node.kind === 243 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226 /* VariableStatement */) { + if (node && node.kind === 225 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10831,30 +10828,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return expr.name; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10891,16 +10888,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: { + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 154 /* QualifiedName */) { + if (name.kind === 153 /* QualifiedName */) { return name.right; } break; } - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10916,15 +10913,15 @@ var ts; return undefined; } } - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 317 /* JSDocEnumTag */: + case 316 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -11160,7 +11157,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11231,11 +11228,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 154 /* QualifiedName */; + return node.kind === 153 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155 /* ComputedPropertyName */; + return node.kind === 154 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11248,164 +11245,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 156 /* TypeParameter */; + return node.kind === 155 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157 /* Parameter */; + return node.kind === 156 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 159 /* PropertySignature */; + return node.kind === 158 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160 /* PropertyDeclaration */; + return node.kind === 159 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161 /* MethodSignature */; + return node.kind === 160 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163 /* Constructor */; + return node.kind === 162 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166 /* CallSignature */; + return node.kind === 165 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167 /* ConstructSignature */; + return node.kind === 166 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168 /* IndexSignature */; + return node.kind === 167 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; + return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 169 /* TypePredicate */; + return node.kind === 168 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170 /* TypeReference */; + return node.kind === 169 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171 /* FunctionType */; + return node.kind === 170 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172 /* ConstructorType */; + return node.kind === 171 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174 /* TypeLiteral */; + return node.kind === 173 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175 /* ArrayType */; + return node.kind === 174 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176 /* TupleType */; + return node.kind === 175 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179 /* UnionType */; + return node.kind === 178 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180 /* IntersectionType */; + return node.kind === 179 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181 /* ConditionalType */; + return node.kind === 180 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182 /* InferType */; + return node.kind === 181 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183 /* ParenthesizedType */; + return node.kind === 182 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184 /* ThisType */; + return node.kind === 183 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185 /* TypeOperator */; + return node.kind === 184 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186 /* IndexedAccessType */; + return node.kind === 185 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187 /* MappedType */; + return node.kind === 186 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188 /* LiteralType */; + return node.kind === 187 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189 /* ImportType */; + return node.kind === 188 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 190 /* ObjectBindingPattern */; + return node.kind === 189 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191 /* ArrayBindingPattern */; + return node.kind === 190 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192 /* BindingElement */; + return node.kind === 191 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 193 /* ArrayLiteralExpression */; + return node.kind === 192 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194 /* ObjectLiteralExpression */; + return node.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11413,7 +11410,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196 /* ElementAccessExpression */; + return node.kind === 195 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11421,7 +11418,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197 /* CallExpression */; + return node.kind === 196 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11431,14 +11428,15 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 195 /* PropertyAccessExpression */ - || kind === 196 /* ElementAccessExpression */ - || kind === 197 /* CallExpression */); + (kind === 194 /* PropertyAccessExpression */ + || kind === 195 /* ElementAccessExpression */ + || kind === 196 /* CallExpression */ + || kind === 218 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; /** @@ -11453,33 +11451,34 @@ var ts; * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`: * * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`) - * 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) - * 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is + * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`) + * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) + * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is * the end of the chain starting at `c?.`) - * 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is + * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is * the end of the chain starting at `a?.`) */ /* @internal */ function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) // cases 1 and 2 - || isOptionalChainRoot(node.parent) // case 3 - || node !== node.parent.expression; // case 4 + return !isOptionalChain(node.parent) // cases 1, 2, and 3 + || isOptionalChainRoot(node.parent) // case 4 + || node !== node.parent.expression; // case 5 } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198 /* NewExpression */; + return node.kind === 197 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199 /* TaggedTemplateExpression */; + return node.kind === 198 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200 /* TypeAssertionExpression */; + return node.kind === 199 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11488,384 +11487,385 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201 /* ParenthesizedExpression */; + return node.kind === 200 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202 /* FunctionExpression */; + return node.kind === 201 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203 /* ArrowFunction */; + return node.kind === 202 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204 /* DeleteExpression */; + return node.kind === 203 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205 /* TypeOfExpression */; + return node.kind === 204 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206 /* VoidExpression */; + return node.kind === 205 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207 /* AwaitExpression */; + return node.kind === 206 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208 /* PrefixUnaryExpression */; + return node.kind === 207 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209 /* PostfixUnaryExpression */; + return node.kind === 208 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210 /* BinaryExpression */; + return node.kind === 209 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211 /* ConditionalExpression */; + return node.kind === 210 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212 /* TemplateExpression */; + return node.kind === 211 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213 /* YieldExpression */; + return node.kind === 212 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214 /* SpreadElement */; + return node.kind === 213 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215 /* ClassExpression */; + return node.kind === 214 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216 /* OmittedExpression */; + return node.kind === 215 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218 /* AsExpression */; + return node.kind === 217 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219 /* NonNullExpression */; + return node.kind === 218 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220 /* MetaProperty */; + return node.kind === 219 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 222 /* TemplateSpan */; + return node.kind === 221 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223 /* SemicolonClassElement */; + return node.kind === 222 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 224 /* Block */; + return node.kind === 223 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226 /* VariableStatement */; + return node.kind === 225 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225 /* EmptyStatement */; + return node.kind === 224 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227 /* ExpressionStatement */; + return node.kind === 226 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228 /* IfStatement */; + return node.kind === 227 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229 /* DoStatement */; + return node.kind === 228 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230 /* WhileStatement */; + return node.kind === 229 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231 /* ForStatement */; + return node.kind === 230 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232 /* ForInStatement */; + return node.kind === 231 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233 /* ForOfStatement */; + return node.kind === 232 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234 /* ContinueStatement */; + return node.kind === 233 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235 /* BreakStatement */; + return node.kind === 234 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; + return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236 /* ReturnStatement */; + return node.kind === 235 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237 /* WithStatement */; + return node.kind === 236 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238 /* SwitchStatement */; + return node.kind === 237 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239 /* LabeledStatement */; + return node.kind === 238 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240 /* ThrowStatement */; + return node.kind === 239 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241 /* TryStatement */; + return node.kind === 240 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242 /* DebuggerStatement */; + return node.kind === 241 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243 /* VariableDeclaration */; + return node.kind === 242 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244 /* VariableDeclarationList */; + return node.kind === 243 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245 /* FunctionDeclaration */; + return node.kind === 244 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246 /* ClassDeclaration */; + return node.kind === 245 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247 /* InterfaceDeclaration */; + return node.kind === 246 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248 /* TypeAliasDeclaration */; + return node.kind === 247 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249 /* EnumDeclaration */; + return node.kind === 248 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */; + return node.kind === 249 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251 /* ModuleBlock */; + return node.kind === 250 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252 /* CaseBlock */; + return node.kind === 251 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253 /* NamespaceExportDeclaration */; + return node.kind === 252 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */; + return node.kind === 253 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255 /* ImportDeclaration */; + return node.kind === 254 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256 /* ImportClause */; + return node.kind === 255 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257 /* NamespaceImport */; + return node.kind === 256 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263 /* NamespaceExport */; + return node.kind === 262 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; + return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258 /* NamedImports */; + return node.kind === 257 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259 /* ImportSpecifier */; + return node.kind === 258 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260 /* ExportAssignment */; + return node.kind === 259 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261 /* ExportDeclaration */; + return node.kind === 260 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262 /* NamedExports */; + return node.kind === 261 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264 /* ExportSpecifier */; + return node.kind === 263 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265 /* MissingDeclaration */; + return node.kind === 264 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 266 /* ExternalModuleReference */; + return node.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 267 /* JsxElement */; + return node.kind === 266 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268 /* JsxSelfClosingElement */; + return node.kind === 267 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269 /* JsxOpeningElement */; + return node.kind === 268 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270 /* JsxClosingElement */; + return node.kind === 269 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271 /* JsxFragment */; + return node.kind === 270 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272 /* JsxOpeningFragment */; + return node.kind === 271 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273 /* JsxClosingFragment */; + return node.kind === 272 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274 /* JsxAttribute */; + return node.kind === 273 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275 /* JsxAttributes */; + return node.kind === 274 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276 /* JsxSpreadAttribute */; + return node.kind === 275 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277 /* JsxExpression */; + return node.kind === 276 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 278 /* CaseClause */; + return node.kind === 277 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279 /* DefaultClause */; + return node.kind === 278 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280 /* HeritageClause */; + return node.kind === 279 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281 /* CatchClause */; + return node.kind === 280 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 282 /* PropertyAssignment */; + return node.kind === 281 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */; + return node.kind === 282 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284 /* SpreadAssignment */; + return node.kind === 283 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 291 /* SourceFile */; + return node.kind === 290 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292 /* Bundle */; + return node.kind === 291 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293 /* UnparsedSource */; + return node.kind === 292 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287 /* UnparsedPrepend */; + return node.kind === 286 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return true; default: return false; @@ -11874,125 +11874,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 /* UnparsedPrologue */ || - node.kind === 290 /* UnparsedSyntheticReference */; + node.kind === 285 /* UnparsedPrologue */ || + node.kind === 289 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 295 /* JSDocTypeExpression */; + return node.kind === 294 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296 /* JSDocAllType */; + return node.kind === 295 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297 /* JSDocUnknownType */; + return node.kind === 296 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298 /* JSDocNullableType */; + return node.kind === 297 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299 /* JSDocNonNullableType */; + return node.kind === 298 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300 /* JSDocOptionalType */; + return node.kind === 299 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301 /* JSDocFunctionType */; + return node.kind === 300 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302 /* JSDocVariadicType */; + return node.kind === 301 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304 /* JSDocComment */; + return node.kind === 303 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310 /* JSDocAuthorTag */; + return node.kind === 309 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308 /* JSDocAugmentsTag */; + return node.kind === 307 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309 /* JSDocImplementsTag */; + return node.kind === 308 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311 /* JSDocClassTag */; + return node.kind === 310 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312 /* JSDocPublicTag */; + return node.kind === 311 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313 /* JSDocPrivateTag */; + return node.kind === 312 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314 /* JSDocProtectedTag */; + return node.kind === 313 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315 /* JSDocReadonlyTag */; + return node.kind === 314 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317 /* JSDocEnumTag */; + return node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320 /* JSDocThisTag */; + return node.kind === 319 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318 /* JSDocParameterTag */; + return node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319 /* JSDocReturnTag */; + return node.kind === 318 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321 /* JSDocTypeTag */; + return node.kind === 320 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322 /* JSDocTemplateTag */; + return node.kind === 321 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323 /* JSDocTypedefTag */; + return node.kind === 322 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324 /* JSDocPropertyTag */; + return node.kind === 323 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; + return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305 /* JSDocTypeLiteral */; + return node.kind === 304 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316 /* JSDocCallbackTag */; + return node.kind === 315 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306 /* JSDocSignature */; + return node.kind === 305 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -12003,7 +12003,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 325 /* SyntaxList */; + return n.kind === 324 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12013,7 +12013,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 154 /* FirstNode */; + return kind >= 153 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12022,7 +12022,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12063,12 +12063,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.isTypeOnly; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12103,13 +12103,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -12132,7 +12132,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 /* QualifiedName */ + return kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12142,14 +12142,14 @@ var ts; || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 155 /* ComputedPropertyName */; + || kind === 154 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 190 /* ObjectBindingPattern */ - || kind === 191 /* ArrayBindingPattern */; + || kind === 189 /* ObjectBindingPattern */ + || kind === 190 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12164,13 +12164,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: return false; @@ -12179,14 +12179,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 172 /* ConstructorType */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 171 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12201,29 +12201,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 160 /* PropertyDeclaration */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 168 /* IndexSignature */ - || kind === 223 /* SemicolonClassElement */; + return kind === 162 /* Constructor */ + || kind === 159 /* PropertyDeclaration */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 167 /* IndexSignature */ + || kind === 222 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); + return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); + return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; default: return false; @@ -12233,11 +12233,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 167 /* ConstructSignature */ - || kind === 166 /* CallSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */ - || kind === 168 /* IndexSignature */; + return kind === 166 /* ConstructSignature */ + || kind === 165 /* CallSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */ + || kind === 167 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12246,12 +12246,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 /* PropertyAssignment */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 284 /* SpreadAssignment */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 281 /* PropertyAssignment */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 283 /* SpreadAssignment */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12266,8 +12266,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return true; } return false; @@ -12278,8 +12278,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 /* ArrayBindingPattern */ - || kind === 190 /* ObjectBindingPattern */; + return kind === 190 /* ArrayBindingPattern */ + || kind === 189 /* ObjectBindingPattern */; } return false; } @@ -12287,15 +12287,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 /* ArrayLiteralExpression */ - || kind === 194 /* ObjectLiteralExpression */; + return kind === 192 /* ArrayLiteralExpression */ + || kind === 193 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 /* BindingElement */ - || kind === 216 /* OmittedExpression */; + return kind === 191 /* BindingElement */ + || kind === 215 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12304,9 +12304,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: return true; } return false; @@ -12327,8 +12327,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return true; } return false; @@ -12340,8 +12340,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return true; } return false; @@ -12350,26 +12350,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */ - || kind === 189 /* ImportType */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */ + || kind === 188 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: return true; default: return false; @@ -12377,12 +12377,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; + return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 /* TemplateExpression */ + return kind === 211 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12393,33 +12393,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 198 /* NewExpression */: - case 197 /* CallExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 199 /* TaggedTemplateExpression */: - case 193 /* ArrayLiteralExpression */: - case 201 /* ParenthesizedExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 198 /* TaggedTemplateExpression */: + case 192 /* ArrayLiteralExpression */: + case 200 /* ParenthesizedExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 219 /* NonNullExpression */: - case 220 /* MetaProperty */: + case 218 /* NonNullExpression */: + case 219 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12433,13 +12433,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 200 /* TypeAssertionExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 199 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12448,9 +12448,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12469,15 +12469,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: - case 203 /* ArrowFunction */: - case 210 /* BinaryExpression */: - case 214 /* SpreadElement */: - case 218 /* AsExpression */: - case 216 /* OmittedExpression */: - case 328 /* CommaListExpression */: - case 327 /* PartiallyEmittedExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: + case 202 /* ArrowFunction */: + case 209 /* BinaryExpression */: + case 213 /* SpreadElement */: + case 217 /* AsExpression */: + case 215 /* OmittedExpression */: + case 327 /* CommaListExpression */: + case 326 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12485,23 +12485,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 /* TypeAssertionExpression */ - || kind === 218 /* AsExpression */; + return kind === 199 /* TypeAssertionExpression */ + || kind === 217 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 327 /* PartiallyEmittedExpression */; + return node.kind === 326 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 326 /* NotEmittedStatement */; + return node.kind === 325 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 331 /* SyntheticReferenceExpression */; + return node.kind === 330 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12512,13 +12512,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12547,7 +12547,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; + return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12571,114 +12571,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */ + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */; + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 250 /* ModuleDeclaration */; + || kind === 249 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 /* NamedImports */ - || kind === 257 /* NamespaceImport */; + return kind === 257 /* NamedImports */ + || kind === 256 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; + return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 /* ArrowFunction */ - || kind === 192 /* BindingElement */ - || kind === 246 /* ClassDeclaration */ - || kind === 215 /* ClassExpression */ - || kind === 163 /* Constructor */ - || kind === 249 /* EnumDeclaration */ - || kind === 285 /* EnumMember */ - || kind === 264 /* ExportSpecifier */ - || kind === 245 /* FunctionDeclaration */ - || kind === 202 /* FunctionExpression */ - || kind === 164 /* GetAccessor */ - || kind === 256 /* ImportClause */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 259 /* ImportSpecifier */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 274 /* JsxAttribute */ - || kind === 162 /* MethodDeclaration */ - || kind === 161 /* MethodSignature */ - || kind === 250 /* ModuleDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 257 /* NamespaceImport */ - || kind === 263 /* NamespaceExport */ - || kind === 157 /* Parameter */ - || kind === 282 /* PropertyAssignment */ - || kind === 160 /* PropertyDeclaration */ - || kind === 159 /* PropertySignature */ - || kind === 165 /* SetAccessor */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 156 /* TypeParameter */ - || kind === 243 /* VariableDeclaration */ - || kind === 323 /* JSDocTypedefTag */ - || kind === 316 /* JSDocCallbackTag */ - || kind === 324 /* JSDocPropertyTag */; + return kind === 202 /* ArrowFunction */ + || kind === 191 /* BindingElement */ + || kind === 245 /* ClassDeclaration */ + || kind === 214 /* ClassExpression */ + || kind === 162 /* Constructor */ + || kind === 248 /* EnumDeclaration */ + || kind === 284 /* EnumMember */ + || kind === 263 /* ExportSpecifier */ + || kind === 244 /* FunctionDeclaration */ + || kind === 201 /* FunctionExpression */ + || kind === 163 /* GetAccessor */ + || kind === 255 /* ImportClause */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportSpecifier */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 273 /* JsxAttribute */ + || kind === 161 /* MethodDeclaration */ + || kind === 160 /* MethodSignature */ + || kind === 249 /* ModuleDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 256 /* NamespaceImport */ + || kind === 262 /* NamespaceExport */ + || kind === 156 /* Parameter */ + || kind === 281 /* PropertyAssignment */ + || kind === 159 /* PropertyDeclaration */ + || kind === 158 /* PropertySignature */ + || kind === 164 /* SetAccessor */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 155 /* TypeParameter */ + || kind === 242 /* VariableDeclaration */ + || kind === 322 /* JSDocTypedefTag */ + || kind === 315 /* JSDocCallbackTag */ + || kind === 323 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 265 /* MissingDeclaration */ - || kind === 246 /* ClassDeclaration */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 249 /* EnumDeclaration */ - || kind === 250 /* ModuleDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 260 /* ExportAssignment */ - || kind === 253 /* NamespaceExportDeclaration */; + return kind === 244 /* FunctionDeclaration */ + || kind === 264 /* MissingDeclaration */ + || kind === 245 /* ClassDeclaration */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 248 /* EnumDeclaration */ + || kind === 249 /* ModuleDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 259 /* ExportAssignment */ + || kind === 252 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 /* BreakStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 229 /* DoStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 225 /* EmptyStatement */ - || kind === 232 /* ForInStatement */ - || kind === 233 /* ForOfStatement */ - || kind === 231 /* ForStatement */ - || kind === 228 /* IfStatement */ - || kind === 239 /* LabeledStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 238 /* SwitchStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 241 /* TryStatement */ - || kind === 226 /* VariableStatement */ - || kind === 230 /* WhileStatement */ - || kind === 237 /* WithStatement */ - || kind === 326 /* NotEmittedStatement */ - || kind === 330 /* EndOfDeclarationMarker */ - || kind === 329 /* MergeDeclarationMarker */; + return kind === 234 /* BreakStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 228 /* DoStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 224 /* EmptyStatement */ + || kind === 231 /* ForInStatement */ + || kind === 232 /* ForOfStatement */ + || kind === 230 /* ForStatement */ + || kind === 227 /* IfStatement */ + || kind === 238 /* LabeledStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 237 /* SwitchStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 240 /* TryStatement */ + || kind === 225 /* VariableStatement */ + || kind === 229 /* WhileStatement */ + || kind === 236 /* WithStatement */ + || kind === 325 /* NotEmittedStatement */ + || kind === 329 /* EndOfDeclarationMarker */ + || kind === 328 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 156 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 155 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12705,10 +12705,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224 /* Block */) + if (node.kind !== 223 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { + if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { return false; } } @@ -12718,8 +12718,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 266 /* ExternalModuleReference */ - || kind === 154 /* QualifiedName */ + return kind === 265 /* ExternalModuleReference */ + || kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12729,70 +12729,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 195 /* PropertyAccessExpression */; + || kind === 194 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 267 /* JsxElement */ - || kind === 277 /* JsxExpression */ - || kind === 268 /* JsxSelfClosingElement */ + return kind === 266 /* JsxElement */ + || kind === 276 /* JsxExpression */ + || kind === 267 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 271 /* JsxFragment */; + || kind === 270 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 /* JsxAttribute */ - || kind === 276 /* JsxSpreadAttribute */; + return kind === 273 /* JsxAttribute */ + || kind === 275 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 277 /* JsxExpression */; + || kind === 276 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 /* JsxOpeningElement */ - || kind === 268 /* JsxSelfClosingElement */; + return kind === 268 /* JsxOpeningElement */ + || kind === 267 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 /* CaseClause */ - || kind === 279 /* DefaultClause */; + return kind === 277 /* CaseClause */ + || kind === 278 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; + return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; + return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12818,13 +12818,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: return true; default: return false; @@ -12832,12 +12832,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13132,7 +13132,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291 /* SourceFile */) { + while (node && node.kind !== 290 /* SourceFile */) { node = node.parent; } return node; @@ -13140,11 +13140,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return true; } return false; @@ -13339,7 +13339,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13464,7 +13464,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; + return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13496,11 +13496,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 && node.kind === 250 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 /* SourceFile */ || - node.kind === 250 /* ModuleDeclaration */ || + return node.kind === 290 /* SourceFile */ || + node.kind === 249 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13517,9 +13517,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node.parent); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13572,22 +13572,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 281 /* CatchClause */: - case 250 /* ModuleDeclaration */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 280 /* CatchClause */: + case 249 /* ModuleDeclaration */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 224 /* Block */: + case 223 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13597,9 +13597,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 306 /* JSDocSignature */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 305 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13609,25 +13609,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13637,8 +13637,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13647,15 +13647,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 226 /* VariableStatement */: - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 225 /* VariableStatement */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return true; default: return false; @@ -13692,7 +13692,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13708,9 +13708,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13771,7 +13771,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224 /* Block */) { + if (node.body && node.body.kind === 223 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13785,7 +13785,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13794,28 +13794,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: errorNode = node.name; break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13867,11 +13867,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13885,7 +13885,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 /* ExpressionStatement */ + return node.kind === 226 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13894,11 +13894,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 /* Parameter */ || - node.kind === 156 /* TypeParameter */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 203 /* ArrowFunction */ || - node.kind === 201 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 156 /* Parameter */ || + node.kind === 155 /* TypeParameter */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 202 /* ArrowFunction */ || + node.kind === 200 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13914,48 +13914,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 206 /* VoidExpression */; - case 217 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 205 /* VoidExpression */; + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156 /* TypeParameter */: - return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; + case 155 /* TypeParameter */: + return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 194 /* 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 === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 154 /* QualifiedName */: - case 195 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 173 /* TypeQuery */) { + if (parent.kind === 172 /* TypeQuery */) { return false; } - if (parent.kind === 189 /* ImportType */) { + if (parent.kind === 188 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13964,40 +13964,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return node === parent.constraint; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return node === parent.constraint; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return node === parent.type; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node === parent.type; - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return node === parent.type; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return node === parent.type; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14022,23 +14022,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitor(node); - case 252 /* CaseBlock */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 251 /* CaseBlock */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14048,23 +14048,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* 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(node.name.expression); @@ -14087,10 +14087,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 175 /* ArrayType */) { + if (node && node.kind === 174 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 170 /* TypeReference */) { + else if (node && node.kind === 169 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14100,12 +14100,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 174 /* TypeLiteral */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 173 /* TypeLiteral */: return node.members; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return node.properties; } } @@ -14113,14 +14113,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192 /* BindingElement */: - case 285 /* EnumMember */: - case 157 /* Parameter */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 284 /* EnumMember */: + case 156 /* Parameter */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 242 /* VariableDeclaration */: return true; } } @@ -14132,8 +14132,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ - && node.parent.parent.kind === 226 /* VariableStatement */; + return node.parent.kind === 243 /* VariableDeclarationList */ + && node.parent.parent.kind === 225 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14144,13 +14144,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return true; } return false; @@ -14161,7 +14161,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239 /* LabeledStatement */) { + if (node.statement.kind !== 238 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14169,17 +14169,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; + return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 /* MethodDeclaration */ && - (node.parent.kind === 194 /* ObjectLiteralExpression */ || - node.parent.kind === 215 /* ClassExpression */); + return node.kind === 161 /* MethodDeclaration */ && + (node.parent.kind === 193 /* ObjectLiteralExpression */ || + node.parent.kind === 214 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14192,7 +14192,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282 /* PropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14233,14 +14233,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291 /* SourceFile */); + ts.Debug.assert(node.kind !== 290 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* 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 @@ -14255,9 +14255,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14268,26 +14268,26 @@ var ts; node = node.parent; } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 250 /* ModuleDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 249 /* EnumDeclaration */: - case 291 /* SourceFile */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 249 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 248 /* EnumDeclaration */: + case 290 /* SourceFile */: return node; } } @@ -14297,9 +14297,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return container; } } @@ -14321,27 +14321,27 @@ var ts; return node; } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: node = node.parent; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14357,14 +14357,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { + if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 201 /* ParenthesizedExpression */) { + while (parent.kind === 200 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14380,7 +14380,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14389,20 +14389,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return node; } return undefined; @@ -14410,10 +14410,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return node.tag; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14426,25 +14426,25 @@ var ts; return false; } switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // classes are valid targets return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 246 /* ClassDeclaration */; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + return parent.kind === 245 /* ClassDeclaration */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 246 /* ClassDeclaration */; - case 157 /* Parameter */: + && parent.kind === 245 /* ClassDeclaration */; + case 156 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 163 /* Constructor */ - || parent.kind === 162 /* MethodDeclaration */ - || parent.kind === 165 /* SetAccessor */) - && grandparent.kind === 246 /* ClassDeclaration */; + && (parent.kind === 162 /* Constructor */ + || parent.kind === 161 /* MethodDeclaration */ + || parent.kind === 164 /* SetAccessor */) + && grandparent.kind === 245 /* ClassDeclaration */; } return false; } @@ -14460,10 +14460,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14472,9 +14472,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 /* JsxOpeningElement */ || - parent.kind === 268 /* JsxSelfClosingElement */ || - parent.kind === 270 /* JsxClosingElement */) { + if (parent.kind === 268 /* JsxOpeningElement */ || + parent.kind === 267 /* JsxSelfClosingElement */ || + parent.kind === 269 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14487,44 +14487,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 218 /* AsExpression */: - case 200 /* TypeAssertionExpression */: - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 210 /* BinaryExpression */: - case 211 /* ConditionalExpression */: - case 214 /* SpreadElement */: - case 212 /* TemplateExpression */: - case 216 /* OmittedExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 213 /* YieldExpression */: - case 207 /* AwaitExpression */: - case 220 /* MetaProperty */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 217 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 209 /* BinaryExpression */: + case 210 /* ConditionalExpression */: + case 213 /* SpreadElement */: + case 211 /* TemplateExpression */: + case 215 /* OmittedExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 212 /* YieldExpression */: + case 206 /* AwaitExpression */: + case 219 /* MetaProperty */: return true; - case 154 /* QualifiedName */: - while (node.parent.kind === 154 /* QualifiedName */) { + case 153 /* QualifiedName */: + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14542,49 +14542,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 191 /* BindingElement */: return parent.initializer === node; - case 227 /* ExpressionStatement */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 236 /* ReturnStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 240 /* ThrowStatement */: + case 226 /* ExpressionStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 235 /* ReturnStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 239 /* ThrowStatement */: return parent.expression === node; - case 231 /* ForStatement */: + case 230 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forInStatement.expression === node; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return node === parent.expression; - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return node === parent.expression; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return node === parent.expression; - case 158 /* Decorator */: - case 277 /* JsxExpression */: - case 276 /* JsxSpreadAttribute */: - case 284 /* SpreadAssignment */: + case 157 /* Decorator */: + case 276 /* JsxExpression */: + case 275 /* JsxSpreadAttribute */: + case 283 /* SpreadAssignment */: return true; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14592,14 +14592,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14608,7 +14608,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14640,11 +14640,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); + (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197 /* CallExpression */) { + if (callExpression.kind !== 196 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14776,11 +14776,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 202 /* FunctionExpression */ || - initializer.kind === 215 /* ClassExpression */ || - initializer.kind === 203 /* ArrowFunction */) { + if (initializer.kind === 201 /* FunctionExpression */ || + initializer.kind === 214 /* ClassExpression */ || + initializer.kind === 202 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15027,7 +15027,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15037,7 +15037,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15046,14 +15046,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.parent; - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return node.parent.parent; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 188 /* LiteralType */: + case 187 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15063,12 +15063,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.moduleSpecifier; - case 254 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 189 /* ImportType */: + case 253 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 188 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15077,11 +15077,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15089,7 +15089,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15110,13 +15110,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157 /* Parameter */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 283 /* ShorthandPropertyAssignment */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 282 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15130,7 +15130,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; + return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15155,12 +15155,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return node.initializer; } } @@ -15171,7 +15171,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 /* ModuleDeclaration */ + node.body.kind === 249 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15186,11 +15186,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156 /* TypeParameter */) { + if (node.kind === 155 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15201,10 +15201,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 /* PropertyAssignment */ || - parent.kind === 260 /* ExportAssignment */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || + if (parent.kind === 281 /* PropertyAssignment */ || + parent.kind === 259 /* ExportAssignment */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15278,7 +15278,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15295,31 +15295,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 201 /* ParenthesizedExpression */: - case 193 /* ArrayLiteralExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 192 /* ArrayLiteralExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: node = parent; break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15346,22 +15346,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224 /* Block */: - case 226 /* VariableStatement */: - case 237 /* WithStatement */: - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 223 /* Block */: + case 225 /* VariableStatement */: + case 236 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return true; } return false; @@ -15378,33 +15378,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183 /* ParenthesizedType */); + return walkUp(node, 182 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201 /* ParenthesizedExpression */); + return walkUp(node, 200 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { + while (node.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { + if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204 /* DeleteExpression */; + return node && node.kind === 203 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15457,7 +15454,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 /* ComputedPropertyName */ && + node.parent.kind === 154 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15465,32 +15462,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 195 /* PropertyAccessExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 194 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 154 /* QualifiedName */) { + while (parent.kind === 153 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; + return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; } return false; - case 192 /* BindingElement */: - case 259 /* ImportSpecifier */: + case 191 /* BindingElement */: + case 258 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 264 /* ExportSpecifier */: - case 274 /* JsxAttribute */: + case 263 /* ExportSpecifier */: + case 273 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15510,33 +15507,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 257 /* NamespaceImport */: - case 264 /* ExportSpecifier */: - case 260 /* ExportAssignment */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 256 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 259 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: return node.parent; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 154 /* QualifiedName */); + } while (node.parent.kind === 153 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15555,7 +15552,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : + return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15621,11 +15618,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15669,14 +15666,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15690,10 +15687,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15726,7 +15723,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { + if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15752,7 +15749,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15815,11 +15812,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157 /* Parameter */; + return root.kind === 156 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192 /* BindingElement */) { + while (node.kind === 191 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15827,15 +15824,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 202 /* FunctionExpression */ - || kind === 245 /* FunctionDeclaration */ - || kind === 203 /* ArrowFunction */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 250 /* ModuleDeclaration */ - || kind === 291 /* SourceFile */; + return kind === 162 /* Constructor */ + || kind === 201 /* FunctionExpression */ + || kind === 244 /* FunctionDeclaration */ + || kind === 202 /* ArrowFunction */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 249 /* ModuleDeclaration */ + || kind === 290 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15854,23 +15851,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: return 1 /* Right */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15894,15 +15891,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210 /* BinaryExpression */) { + if (expression.kind === 209 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { + else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15912,15 +15909,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return 0; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return 1; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return 2; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return 4; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15941,21 +15938,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: return 16; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return 17; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return 18; - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 19 : 18; - case 199 /* TaggedTemplateExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 198 /* TaggedTemplateExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15966,19 +15963,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 201 /* ParenthesizedExpression */: - case 216 /* OmittedExpression */: + case 211 /* TemplateExpression */: + case 200 /* ParenthesizedExpression */: + case 215 /* OmittedExpression */: return 20; default: return -1; @@ -16589,10 +16586,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 165 /* SetAccessor */) { + else if (accessor.kind === 164 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16612,10 +16609,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 /* GetAccessor */ && !getAccessor) { + if (member.kind === 163 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 165 /* SetAccessor */ && !setAccessor) { + if (member.kind === 164 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16664,7 +16661,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16888,7 +16885,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16930,11 +16927,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 131 /* DeclareKeyword */: return 2 /* Ambient */; + case 130 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16974,8 +16971,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 194 /* ObjectLiteralExpression */ - || kind === 193 /* ArrayLiteralExpression */; + return kind === 193 /* ObjectLiteralExpression */ + || kind === 192 /* ArrayLiteralExpression */; } return false; } @@ -16992,12 +16989,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -17007,8 +17004,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17038,17 +17035,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 /* ObjectLiteralExpression */ && + return expression.kind === 193 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 /* ArrayLiteralExpression */ && + return expression.kind === 192 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17372,8 +17369,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17450,35 +17447,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return accessKind(parent); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 282 /* PropertyAssignment */: { + case 281 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17627,39 +17624,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) + return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 149 /* UnknownKeyword */ - || kind === 141 /* NumberKeyword */ - || kind === 152 /* BigIntKeyword */ - || kind === 142 /* ObjectKeyword */ - || kind === 129 /* BooleanKeyword */ - || kind === 144 /* StringKeyword */ - || kind === 145 /* SymbolKeyword */ + || kind === 148 /* UnknownKeyword */ + || kind === 140 /* NumberKeyword */ + || kind === 151 /* BigIntKeyword */ + || kind === 141 /* ObjectKeyword */ + || kind === 128 /* BooleanKeyword */ + || kind === 143 /* StringKeyword */ + || kind === 144 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 147 /* UndefinedKeyword */ + || kind === 146 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 138 /* NeverKeyword */ - || kind === 217 /* ExpressionWithTypeArguments */ - || kind === 296 /* JSDocAllType */ - || kind === 297 /* JSDocUnknownType */ - || kind === 298 /* JSDocNullableType */ - || kind === 299 /* JSDocNonNullableType */ - || kind === 300 /* JSDocOptionalType */ - || kind === 301 /* JSDocFunctionType */ - || kind === 302 /* JSDocVariadicType */; + || kind === 137 /* NeverKeyword */ + || kind === 216 /* ExpressionWithTypeArguments */ + || kind === 295 /* JSDocAllType */ + || kind === 296 /* JSDocUnknownType */ + || kind === 297 /* JSDocNullableType */ + || kind === 298 /* JSDocNonNullableType */ + || kind === 299 /* JSDocOptionalType */ + || kind === 300 /* JSDocFunctionType */ + || kind === 301 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195 /* PropertyAccessExpression */) { + if (node.kind === 194 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17674,7 +17671,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; + return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18758,21 +18755,21 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; + return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { @@ -18780,16 +18777,16 @@ var ts; return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return true; - case 195 /* PropertyAccessExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 194 /* PropertyAccessExpression */: + case 216 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18809,7 +18806,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291 /* SourceFile */) { + if (kind === 290 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18864,19 +18861,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153 /* LastToken */) { + if (!node || node.kind <= 152 /* LastToken */) { return; } switch (node.kind) { - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18884,9 +18881,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18894,7 +18891,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18902,51 +18899,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18958,359 +18955,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 176 /* TupleType */: + case 175 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182 /* InferType */: + case 181 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 189 /* ImportType */: + case 188 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183 /* ParenthesizedType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 184 /* TypeOperator */: return visitNode(cbNode, node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187 /* MappedType */: + case 186 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return visitNode(cbNode, node.literal); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitNode(cbNode, node.name); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return visitNode(cbNode, node.label); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158 /* Decorator */: + case 157 /* Decorator */: return visitNode(cbNode, node.expression); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 177 /* OptionalType */: - case 178 /* RestType */: - case 295 /* JSDocTypeExpression */: - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 300 /* JSDocOptionalType */: - case 302 /* JSDocVariadicType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 294 /* JSDocTypeExpression */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 299 /* JSDocOptionalType */: + case 301 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310 /* JSDocAuthorTag */: + case 309 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 /* JSDocTypeExpression */ + node.typeExpression.kind === 294 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307 /* JSDocTag */: - case 311 /* JSDocClassTag */: - case 312 /* JSDocPublicTag */: - case 313 /* JSDocPrivateTag */: - case 314 /* JSDocProtectedTag */: - case 315 /* JSDocReadonlyTag */: + case 306 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 311 /* JSDocPublicTag */: + case 312 /* JSDocPrivateTag */: + case 313 /* JSDocProtectedTag */: + case 314 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19599,7 +19596,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227 /* ExpressionStatement */); + var statement = createNode(226 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19751,7 +19748,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -20083,7 +20080,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 226 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20195,7 +20192,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(155 /* ComputedPropertyName */); + var node = createNode(154 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20237,15 +20234,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146 /* TypeKeyword */) { + if (token() === 145 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20655,20 +20652,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163 /* Constructor */: - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 223 /* SemicolonClassElement */: + case 162 /* Constructor */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 222 /* SemicolonClassElement */: return true; - case 162 /* MethodDeclaration */: + case 161 /* 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 === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20677,8 +20674,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return true; } } @@ -20687,58 +20684,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 226 /* VariableStatement */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 227 /* ExpressionStatement */: - case 240 /* ThrowStatement */: - case 236 /* ReturnStatement */: - case 238 /* SwitchStatement */: - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 225 /* EmptyStatement */: - case 241 /* TryStatement */: - case 239 /* LabeledStatement */: - case 229 /* DoStatement */: - case 242 /* DebuggerStatement */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 225 /* VariableStatement */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 226 /* ExpressionStatement */: + case 239 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 237 /* SwitchStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 224 /* EmptyStatement */: + case 240 /* TryStatement */: + case 238 /* LabeledStatement */: + case 228 /* DoStatement */: + case 241 /* DebuggerStatement */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 159 /* PropertySignature */: - case 166 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 158 /* PropertySignature */: + case 165 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243 /* VariableDeclaration */) { + if (node.kind !== 242 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20759,7 +20756,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157 /* Parameter */) { + if (node.kind !== 156 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20898,7 +20895,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154 /* QualifiedName */, entity.pos); + var node = createNode(153 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20939,7 +20936,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212 /* TemplateExpression */); + var template = createNode(211 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20951,7 +20948,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222 /* TemplateSpan */); + var span = createNode(221 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -21017,7 +21014,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -21027,14 +21024,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: { + case 170 /* FunctionType */: + case 171 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -21042,20 +21039,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169 /* TypePredicate */, lhs.pos); + var node = createNode(168 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184 /* ThisType */); + var node = createNode(183 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296 /* JSDocAllType */); + var result = createNode(295 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(300 /* JSDocOptionalType */, result); + return createPostfixType(299 /* JSDocOptionalType */, result); } else { nextToken(); @@ -21063,7 +21060,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299 /* JSDocNonNullableType */); + var result = createNode(298 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -21087,28 +21084,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(297 /* JSDocUnknownType */, pos); + var result = createNode(296 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(298 /* JSDocNullableType */, pos); + var result = createNode(297 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157 /* Parameter */); + var parameter = createNode(156 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -21118,9 +21115,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -21139,23 +21136,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(300 /* JSDocOptionalType */, type); + return createPostfixType(299 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(173 /* TypeQuery */); + var node = createNode(172 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21200,7 +21197,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157 /* Parameter */); + var node = createNodeWithJSDoc(156 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21301,7 +21298,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167 /* ConstructSignature */) { + if (kind === 166 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21362,7 +21359,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 168 /* IndexSignature */; + node.kind = 167 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21372,13 +21369,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 161 /* MethodSignature */; + node.kind = 160 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 159 /* PropertySignature */; + node.kind = 158 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21424,10 +21421,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(166 /* CallSignature */); + return parseSignatureMember(165 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167 /* ConstructSignature */); + return parseSignatureMember(166 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21453,7 +21450,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174 /* TypeLiteral */); + var node = createNode(173 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21471,27 +21468,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 139 /* ReadonlyKeyword */; + return nextToken() === 138 /* ReadonlyKeyword */; } - if (token() === 139 /* ReadonlyKeyword */) { + if (token() === 138 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187 /* MappedType */); + var node = createNode(186 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { - parseExpectedToken(139 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + parseExpectedToken(138 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21511,23 +21508,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(178 /* RestType */, pos); + var node = createNode(177 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 177 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 176 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(176 /* TupleType */); + var node = createNode(175 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183 /* ParenthesizedType */); + var node = createNode(182 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21535,7 +21532,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21545,10 +21542,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188 /* LiteralType */); + var node = createNode(187 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21569,7 +21566,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(189 /* ImportType */); + var node = createNode(188 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21592,15 +21589,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 145 /* SymbolKeyword */: - case 129 /* BooleanKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 144 /* SymbolKeyword */: + case 128 /* BooleanKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21631,7 +21628,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21657,20 +21654,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 139 /* ReadonlyKeyword */: - case 145 /* SymbolKeyword */: - case 148 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 138 /* ReadonlyKeyword */: + case 144 /* SymbolKeyword */: + case 147 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21682,12 +21679,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21712,26 +21709,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(299 /* JSDocNonNullableType */, type); + type = createPostfixType(298 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298 /* JSDocNullableType */, type); + type = createPostfixType(297 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(186 /* IndexedAccessType */, type.pos); + var node = createNode(185 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(175 /* ArrayType */, type.pos); + var node = createNode(174 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21750,16 +21747,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185 /* TypeOperator */); + var node = createNode(184 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182 /* InferType */); - parseExpected(133 /* InferKeyword */); - var typeParameter = createNode(156 /* TypeParameter */); + var node = createNode(181 /* InferType */); + parseExpected(132 /* InferKeyword */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21767,12 +21764,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135 /* KeyOfKeyword */: - case 148 /* UniqueKeyword */: - case 139 /* ReadonlyKeyword */: - case 128 /* AwaitedKeyword */: + case 134 /* KeyOfKeyword */: + case 147 /* UniqueKeyword */: + case 138 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21793,10 +21789,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21853,7 +21849,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21865,16 +21861,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169 /* TypePredicate */); + var node = createNode(168 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21888,7 +21884,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(181 /* ConditionalType */, type.pos); + var node = createNode(180 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -22083,7 +22079,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213 /* YieldExpression */); + var node = createNode(212 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -22105,13 +22101,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203 /* ArrowFunction */, asyncModifier.pos); + node = createNode(202 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203 /* ArrowFunction */, identifier.pos); + node = createNode(202 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(157 /* Parameter */, identifier.pos); + var parameter = createNode(156 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22316,7 +22312,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203 /* ArrowFunction */); + var node = createNodeWithJSDoc(202 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22382,7 +22378,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22397,7 +22393,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22462,39 +22458,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210 /* BinaryExpression */, left.pos); + var node = createNode(209 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218 /* AsExpression */, left.pos); + var node = createNode(217 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204 /* DeleteExpression */); + var node = createNode(203 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205 /* TypeOfExpression */); + var node = createNode(204 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206 /* VoidExpression */); + var node = createNode(205 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22510,7 +22506,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207 /* AwaitExpression */); + var node = createNode(206 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22554,7 +22550,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { parseErrorAt(pos, end, 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 { @@ -22651,7 +22647,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22664,7 +22660,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22720,7 +22716,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(220 /* MetaProperty */, fullStart); + var node = createNode(219 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22803,7 +22799,7 @@ var ts; } // 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(195 /* PropertyAccessExpression */, expression.pos); + var node = createNode(194 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22813,8 +22809,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269 /* JsxOpeningElement */) { - var node = createNode(267 /* JsxElement */, opening.pos); + if (opening.kind === 268 /* JsxOpeningElement */) { + var node = createNode(266 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22823,15 +22819,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272 /* JsxOpeningFragment */) { - var node = createNode(271 /* JsxFragment */, opening.pos); + else if (opening.kind === 271 /* JsxOpeningFragment */) { + var node = createNode(270 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22846,7 +22842,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210 /* BinaryExpression */, result.pos); + var badNode = createNode(209 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22909,7 +22905,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275 /* JsxAttributes */); + var jsxAttributes = createNode(274 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22918,7 +22914,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22930,7 +22926,7 @@ var ts; // 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(269 /* JsxOpeningElement */, fullStart); + node = createNode(268 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22942,7 +22938,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(268 /* JsxSelfClosingElement */, fullStart); + node = createNode(267 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22959,7 +22955,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22967,7 +22963,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277 /* JsxExpression */); + var node = createNode(276 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22993,7 +22989,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274 /* JsxAttribute */); + var node = createNode(273 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -23008,7 +23004,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276 /* JsxSpreadAttribute */); + var node = createNode(275 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -23016,7 +23012,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270 /* JsxClosingElement */); + var node = createNode(269 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -23029,7 +23025,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273 /* JsxClosingFragment */); + var node = createNode(272 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -23044,7 +23040,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200 /* TypeAssertionExpression */); + var node = createNode(199 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -23061,12 +23057,33 @@ var ts; return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32 /* OptionalChain */) { + return true; + } + // check for an optional chain in a non-null expression + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + expr = expr.expression; + } + if (expr.flags & 32 /* OptionalChain */) { + // this is part of an optional chain. Walk down from `node` to `expression` and set the flag. + while (ts.isNonNullExpression(node)) { + node.flags |= 32 /* OptionalChain */; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32 /* OptionalChain */; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -23075,7 +23092,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -23089,7 +23106,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32 /* OptionalChain */; } return finishNode(indexedAccess); @@ -23111,7 +23128,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -23132,7 +23149,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -23160,12 +23177,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23173,11 +23190,11 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23185,7 +23202,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23304,28 +23321,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214 /* SpreadElement */); + var node = createNode(213 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193 /* ArrayLiteralExpression */); + var node = createNode(192 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23337,17 +23354,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 284 /* SpreadAssignment */; + node.kind = 283 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23365,7 +23382,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 283 /* ShorthandPropertyAssignment */; + node.kind = 282 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23373,14 +23390,14 @@ var ts; } } else { - node.kind = 282 /* PropertyAssignment */; + node.kind = 281 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194 /* ObjectLiteralExpression */); + var node = createNode(193 /* ObjectLiteralExpression */); var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { @@ -23405,7 +23422,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(202 /* FunctionExpression */); + var node = createNodeWithJSDoc(201 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23430,7 +23447,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(220 /* MetaProperty */, fullStart); + var node_2 = createNode(219 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23447,7 +23464,7 @@ var ts; } break; } - var node = createNode(198 /* NewExpression */, fullStart); + var node = createNode(197 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23457,7 +23474,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224 /* Block */); + var node = createNode(223 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23496,12 +23513,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225 /* EmptyStatement */); + var node = createNode(224 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(228 /* IfStatement */); + var node = createNode(227 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23511,7 +23528,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229 /* DoStatement */); + var node = createNode(228 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23526,7 +23543,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230 /* WhileStatement */); + var node = createNode(229 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23549,8 +23566,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { - var forOfStatement = createNode(233 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { + var forOfStatement = createNode(232 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23558,14 +23575,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(232 /* ForInStatement */, pos); + var forInStatement = createNode(231 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231 /* ForStatement */, pos); + var forStatement = createNode(230 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23583,7 +23600,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23591,7 +23608,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236 /* ReturnStatement */); + var node = createNode(235 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23600,7 +23617,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237 /* WithStatement */); + var node = createNode(236 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23609,7 +23626,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278 /* CaseClause */); + var node = createNode(277 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23617,7 +23634,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279 /* DefaultClause */); + var node = createNode(278 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23627,12 +23644,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238 /* SwitchStatement */); + var node = createNode(237 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(252 /* CaseBlock */); + var caseBlock = createNode(251 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23647,7 +23664,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(240 /* ThrowStatement */); + var node = createNode(239 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23655,7 +23672,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(241 /* TryStatement */); + var node = createNode(240 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23668,7 +23685,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281 /* CatchClause */); + var result = createNode(280 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23682,7 +23699,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242 /* DebuggerStatement */); + var node = createNode(241 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23691,15 +23708,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 226 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 239 /* LabeledStatement */; + node.kind = 238 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227 /* ExpressionStatement */; + node.kind = 226 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23753,25 +23770,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23780,7 +23797,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 146 /* TypeKeyword */) { + if (currentToken_1 === 145 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23834,19 +23851,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 146 /* TypeKeyword */: - case 151 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 145 /* TypeKeyword */: + case 150 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23870,16 +23887,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23889,9 +23906,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(234 /* ContinueStatement */); + return parseBreakOrContinueStatement(233 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(235 /* BreakStatement */); + return parseBreakOrContinueStatement(234 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23912,10 +23929,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 131 /* DeclareKeyword */: + case 145 /* TypeKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23925,8 +23942,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: - case 151 /* GlobalKeyword */: + case 138 /* ReadonlyKeyword */: + case 150 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23935,7 +23952,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131 /* DeclareKeyword */; + return modifier.kind === 130 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23983,13 +24000,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 151 /* GlobalKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 150 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -24008,7 +24025,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -24031,16 +24048,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(216 /* OmittedExpression */); + return createNode(215 /* OmittedExpression */); } - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -24056,14 +24073,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190 /* ObjectBindingPattern */); + var node = createNode(189 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191 /* ArrayBindingPattern */); + var node = createNode(190 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -24088,7 +24105,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243 /* VariableDeclaration */); + var node = createNode(242 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -24101,7 +24118,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244 /* VariableDeclarationList */); + var node = createNode(243 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -24124,7 +24141,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -24139,13 +24156,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 226 /* VariableStatement */; + node.kind = 225 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245 /* FunctionDeclaration */; + node.kind = 244 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -24156,8 +24173,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130 /* ConstructorKeyword */) { - return parseExpected(130 /* ConstructorKeyword */); + if (token() === 129 /* ConstructorKeyword */) { + return parseExpected(129 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -24169,7 +24186,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163 /* Constructor */; + node.kind = 162 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -24177,7 +24194,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162 /* MethodDeclaration */; + node.kind = 161 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -24186,7 +24203,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160 /* PropertyDeclaration */; + node.kind = 159 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24248,7 +24265,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24280,7 +24297,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(158 /* Decorator */, decoratorStart); + var decorator = createNode(157 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24330,20 +24347,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(223 /* SemicolonClassElement */); + var result = createNode(222 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } - if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24380,10 +24397,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24426,14 +24443,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(280 /* HeritageClause */); + var node = createNode(279 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24449,7 +24466,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247 /* InterfaceDeclaration */; + node.kind = 246 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24458,8 +24475,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248 /* TypeAliasDeclaration */; - parseExpected(146 /* TypeKeyword */); + node.kind = 247 /* TypeAliasDeclaration */; + parseExpected(145 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24472,13 +24489,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(285 /* EnumMember */); + var node = createNodeWithJSDoc(284 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249 /* EnumDeclaration */; + node.kind = 248 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24491,7 +24508,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251 /* ModuleBlock */); + var node = createNode(250 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24502,7 +24519,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250 /* ModuleDeclaration */; + node.kind = 249 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24514,8 +24531,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250 /* ModuleDeclaration */; - if (token() === 151 /* GlobalKeyword */) { + node.kind = 249 /* ModuleDeclaration */; + if (token() === 150 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24534,15 +24551,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151 /* GlobalKeyword */) { + if (token() === 150 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137 /* NamespaceKeyword */)) { + else if (parseOptional(136 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(136 /* ModuleKeyword */); + parseExpected(135 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24550,7 +24567,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 /* RequireKeyword */ && + return token() === 139 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24560,9 +24577,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 253 /* NamespaceExportDeclaration */; + node.kind = 252 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(137 /* NamespaceKeyword */); + parseExpected(136 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24575,7 +24592,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 /* FromKeyword */ && + if (token() !== 149 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24585,7 +24602,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 255 /* ImportDeclaration */; + node.kind = 254 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24594,7 +24611,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24606,10 +24623,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254 /* ImportEqualsDeclaration */; + node.kind = 253 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24627,7 +24644,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(256 /* ImportClause */, fullStart); + var importClause = createNode(255 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24638,7 +24655,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); } return finishNode(importClause); } @@ -24648,8 +24665,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(266 /* ExternalModuleReference */); - parseExpected(140 /* RequireKeyword */); + var node = createNode(265 /* ExternalModuleReference */); + parseExpected(139 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24671,7 +24688,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(257 /* NamespaceImport */); + var namespaceImport = createNode(256 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24686,14 +24703,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264 /* ExportSpecifier */); + return parseImportOrExportSpecifier(263 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259 /* ImportSpecifier */); + return parseImportOrExportSpecifier(258 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24718,34 +24735,34 @@ var ts; else { node.name = identifierName; } - if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263 /* NamespaceExport */, pos); + var node = createNode(262 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(146 /* TypeKeyword */); + node.kind = 260 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(145 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(150 /* FromKeyword */); + if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24753,7 +24770,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260 /* ExportAssignment */; + node.kind = 259 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24773,10 +24790,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ - || node.kind === 255 /* ImportDeclaration */ - || node.kind === 260 /* ExportAssignment */ - || node.kind === 261 /* ExportDeclaration */ ? node : undefined; + || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ + || node.kind === 254 /* ImportDeclaration */ + || node.kind === 259 /* ExportAssignment */ + || node.kind === 260 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24842,7 +24859,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295 /* JSDocTypeExpression */); + var result = createNode(294 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -25005,7 +25022,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304 /* JSDocComment */, start); + var result = createNode(303 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -25075,19 +25092,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25222,7 +25239,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307 /* JSDocTag */, start); + var result = createNode(306 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25267,9 +25284,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25285,8 +25302,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(324 /* JSDocPropertyTag */, start) : - createNode(318 /* JSDocParameterTag */, start); + createNode(323 /* JSDocPropertyTag */, start) : + createNode(317 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25303,20 +25320,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { + if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25328,7 +25345,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319 /* JSDocReturnTag */, start); + var result = createNode(318 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25337,13 +25354,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321 /* JSDocTypeTag */, start); + var result = createNode(320 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310 /* JSDocAuthorTag */, start); + var result = createNode(309 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25397,20 +25414,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309 /* JSDocImplementsTag */, start); + var result = createNode(308 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308 /* JSDocAugmentsTag */, start); + var result = createNode(307 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25422,7 +25439,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(195 /* PropertyAccessExpression */, node.pos); + var prop = createNode(194 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25435,14 +25452,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320 /* JSDocThisTag */, start); + var tag = createNode(319 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317 /* JSDocEnumTag */, start); + var tag = createNode(316 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25451,7 +25468,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323 /* JSDocTypedefTag */, start); + var typedefTag = createNode(322 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25465,9 +25482,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); } - if (child.kind === 321 /* JSDocTypeTag */) { + if (child.kind === 320 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25480,7 +25497,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25499,7 +25516,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25513,14 +25530,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316 /* JSDocCallbackTag */, start); + var callbackTag = createNode(315 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306 /* JSDocSignature */, start); + var jsdocSignature = createNode(305 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25528,7 +25545,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 319 /* JSDocReturnTag */) { + if (tag && tag.kind === 318 /* JSDocReturnTag */) { return tag; } } @@ -25573,7 +25590,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && + if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25637,13 +25654,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156 /* TypeParameter */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(322 /* JSDocTemplateTag */, start); + var result = createNode(321 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -27952,7 +27969,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282 /* PropertyAssignment */) { + if (element.kind !== 281 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -28043,13 +28060,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -28066,7 +28083,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30494,26 +30511,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30529,7 +30546,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 251 /* ModuleBlock */: { + case 250 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30551,7 +30568,7 @@ var ts; }); return state_1; } - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30759,7 +30776,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 260 /* ExportAssignment */) { + if (node.kind === 259 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30768,7 +30785,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30796,36 +30813,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "__constructor" /* Constructor */; - case 171 /* FunctionType */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: return "__call" /* Call */; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return "__new" /* New */; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "__index" /* Index */; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 157 /* Parameter */: + case 156 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30925,7 +30942,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30964,7 +30981,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -31031,7 +31048,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -31064,7 +31081,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -31079,13 +31096,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -31129,8 +31146,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -31162,90 +31179,93 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: bindWhileStatement(node); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: bindDoStatement(node); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: bindForStatement(node); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: bindIfStatement(node); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: bindTryStatement(node); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: bindSwitchStatement(node); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: bindCaseBlock(node); break; - case 278 /* CaseClause */: + case 277 /* CaseClause */: bindCaseClause(node); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: bindLabeledStatement(node); break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: bindCallExpressionFlow(node); break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 218 /* NonNullExpression */: + bindNonNullExpressionFlow(node); + break; + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 291 /* SourceFile */: { + case 290 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31258,18 +31278,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return hasNarrowableArgument(expr); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31291,7 +31311,7 @@ var ts; } } } - if (expr.expression.kind === 195 /* PropertyAccessExpression */ && + if (expr.expression.kind === 194 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31324,9 +31344,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31402,26 +31422,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return parent.expression === node; - case 231 /* ForStatement */: - case 211 /* ConditionalExpression */: + case 230 /* ForStatement */: + case 210 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201 /* ParenthesizedExpression */) { + if (node.kind === 200 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31463,7 +31483,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239 /* LabeledStatement */) { + while (label && node.parent.kind === 238 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31514,12 +31534,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233 /* ForOfStatement */) { + if (node.kind === 232 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244 /* VariableDeclarationList */) { + if (node.initializer.kind !== 243 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31541,7 +31561,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236 /* ReturnStatement */) { + if (node.kind === 235 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31558,7 +31578,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31658,7 +31678,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31707,7 +31727,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 197 /* CallExpression */) { + if (node.expression.kind === 196 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31733,7 +31753,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31744,10 +31764,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 193 /* ArrayLiteralExpression */) { + else if (node.kind === 192 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214 /* SpreadElement */) { + if (e.kind === 213 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31755,16 +31775,16 @@ var ts; } } } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282 /* PropertyAssignment */) { + if (p.kind === 281 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283 /* ShorthandPropertyAssignment */) { + else if (p.kind === 282 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284 /* SpreadAssignment */) { + else if (p.kind === 283 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31886,7 +31906,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31948,7 +31968,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31987,14 +32007,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162 /* MethodDeclaration */) { + if (host && host.kind !== 161 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -32006,15 +32026,17 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: + bind(node.questionDotToken); bind(node.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -32032,7 +32054,7 @@ var ts; // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest // of the node as part of the "true" branch, and continue to do so as we ascend back up to the outermost // chain node. We then treat the entire node as the right side of the expression. - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -32053,6 +32075,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -32070,7 +32100,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { + if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -32079,7 +32109,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -32088,54 +32118,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 275 /* JsxAttributes */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 274 /* JsxAttributes */: return 1 /* IsContainer */; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 301 /* JSDocFunctionType */: - case 171 /* FunctionType */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 172 /* ConstructorType */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 300 /* JSDocFunctionType */: + case 170 /* FunctionType */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 171 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 281 /* CatchClause */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 252 /* CaseBlock */: + case 280 /* CatchClause */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 251 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 224 /* Block */: + case 223 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -32168,45 +32198,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 194 /* ObjectLiteralExpression */: - case 247 /* InterfaceDeclaration */: - case 275 /* JsxAttributes */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 193 /* ObjectLiteralExpression */: + case 246 /* InterfaceDeclaration */: + case 274 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 306 /* JSDocSignature */: - case 168 /* IndexSignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 301 /* JSDocFunctionType */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 305 /* JSDocSignature */: + case 167 /* IndexSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 300 /* JSDocFunctionType */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32307,7 +32337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32319,7 +32349,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ + var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32351,10 +32381,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32540,8 +32570,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 291 /* SourceFile */ && - blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 290 /* SourceFile */ && + blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32636,7 +32666,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 153 /* LastToken */) { + if (node.kind > 152 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32712,14 +32742,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32734,7 +32764,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32762,78 +32792,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return checkStrictModeCatchClause(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkStrictModeWithStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 184 /* ThisType */: + case 183 /* ThisType */: seenThisKeyword = true; return; - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: break; // Binding the children will handle everything - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return bindTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return bindParameter(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return bindPropertyWorker(node); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: + case 171 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 187 /* MappedType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 186 /* MappedType */: return bindAnonymousTypeWorker(node); - case 311 /* JSDocClassTag */: + case 310 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return bindFunctionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32852,65 +32882,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return bindJsxAttributes(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return bindImportClause(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return bindExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return bindExportAssignment(node); - case 291 /* SourceFile */: + case 290 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224 /* Block */: + case 223 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 318 /* JSDocParameterTag */: - if (node.parent.kind === 306 /* JSDocSignature */) { + case 317 /* JSDocParameterTag */: + if (node.parent.kind === 305 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { break; } // falls through - case 324 /* JSDocPropertyTag */: + case 323 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -33066,8 +33096,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -33089,11 +33119,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -33105,7 +33135,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -33135,7 +33165,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -33175,7 +33205,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33277,8 +33307,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ - : propertyAccess.parent.parent.kind === 291 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ + : propertyAccess.parent.parent.kind === 290 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33357,7 +33387,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246 /* ClassDeclaration */) { + if (node.kind === 245 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33420,7 +33450,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { + if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33497,7 +33527,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 182 /* InferType */) { + else if (node.parent.kind === 181 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33525,11 +33555,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || // report error on class declarations - node.kind === 246 /* ClassDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33573,12 +33603,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33627,58 +33657,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 157 /* Parameter */: + case 156 /* Parameter */: return computeParameter(node, subtreeFlags); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163 /* Constructor */: + case 162 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33729,12 +33759,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33782,8 +33812,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 218 /* AsExpression */ - || expressionKind === 200 /* TypeAssertionExpression */) { + if (expressionKind === 217 /* AsExpression */ + || expressionKind === 199 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -34131,13 +34161,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -34146,27 +34176,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 219 /* NonNullExpression */: - case 139 /* ReadonlyKeyword */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 218 /* NonNullExpression */: + case 138 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: case 11 /* JsxText */: - case 270 /* JsxClosingElement */: - case 271 /* JsxFragment */: - case 272 /* JsxOpeningFragment */: - case 273 /* JsxClosingFragment */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 277 /* JsxExpression */: + case 269 /* JsxClosingElement */: + case 270 /* JsxFragment */: + case 271 /* JsxOpeningFragment */: + case 272 /* JsxClosingFragment */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 276 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -34179,16 +34209,16 @@ var ts; break; } // falls through - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 212 /* TemplateExpression */: - case 283 /* ShorthandPropertyAssignment */: + case 211 /* TemplateExpression */: + case 282 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34205,70 +34235,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 169 /* TypePredicate */: - case 170 /* TypeReference */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 173 /* TypeQuery */: - case 174 /* TypeLiteral */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 182 /* InferType */: - case 183 /* ParenthesizedType */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: - case 253 /* NamespaceExportDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 168 /* TypePredicate */: + case 169 /* TypeReference */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 172 /* TypeQuery */: + case 173 /* TypeLiteral */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 181 /* InferType */: + case 182 /* ParenthesizedType */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: + case 252 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34280,28 +34310,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34314,29 +34344,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34357,67 +34387,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { + if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 193 /* ArrayLiteralExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 192 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 157 /* Parameter */: + case 156 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 163 /* Constructor */: + case 162 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 144 /* StringKeyword */: - case 142 /* ObjectKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 143 /* StringKeyword */: + case 141 /* ObjectKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 281 /* CatchClause */: + case 280 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: - case 201 /* ParenthesizedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: + case 200 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34592,7 +34622,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 173 /* TypeQuery */) { + if (d.type && d.type.kind === 172 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35234,7 +35264,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35800,7 +35829,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35858,17 +35887,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 192 /* BindingElement */) { + if (declaration.kind === 191 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); } - else if (declaration.kind === 243 /* VariableDeclaration */) { + else if (declaration.kind === 242 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35899,12 +35928,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35924,9 +35953,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226 /* VariableStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 225 /* VariableStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35947,16 +35976,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 /* PropertyDeclaration */ && + current.parent.kind === 159 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 162 /* MethodDeclaration */) { + if (declaration.kind === 161 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35978,19 +36007,19 @@ var ts; return "quit"; } switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224 /* Block */: + case 223 /* Block */: switch (node.parent.kind) { - case 164 /* GetAccessor */: - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return true; default: return false; @@ -36036,12 +36065,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 157 /* Parameter */ || - lastLocation.kind === 156 /* TypeParameter */ + lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 155 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -36058,13 +36087,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181 /* ConditionalType */) { + else if (location.kind === 180 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -36079,14 +36108,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -36110,7 +36139,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { break; } } @@ -36124,12 +36153,12 @@ var ts; } } break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -36146,9 +36175,9 @@ var ts; } } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -36167,7 +36196,7 @@ var ts; } break loop; } - if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36175,7 +36204,7 @@ var ts; } } break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -36195,9 +36224,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36205,24 +36234,24 @@ var ts; } } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36235,7 +36264,7 @@ var ts; } } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36244,7 +36273,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 157 /* Parameter */) { + if (location.parent && location.parent.kind === 156 /* Parameter */) { location = location.parent; } // @@ -36259,25 +36288,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { location = location.parent; } break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 157 /* Parameter */: + case 156 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157 /* Parameter */) { + if (root.kind === 156 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36297,7 +36326,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36414,10 +36443,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { + if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36430,12 +36459,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: // For `namespace N { N; }` + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36447,7 +36476,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156 /* TypeParameter */) { + if (decl.kind === 155 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36503,9 +36532,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36549,7 +36578,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36608,7 +36637,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36643,13 +36672,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36673,28 +36702,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36995,28 +37024,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 260 /* ExportAssignment */: - case 210 /* BinaryExpression */: + case 259 /* ExportAssignment */: + case 209 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -37168,13 +37197,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -37198,9 +37227,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { - var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { + var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37235,7 +37264,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37457,7 +37486,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37744,7 +37773,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37831,12 +37860,12 @@ var ts; } } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37845,9 +37874,9 @@ var ts; return { value: result }; } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37930,7 +37959,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37974,7 +38003,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37989,10 +38018,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: continue; default: return false; @@ -38123,10 +38152,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38173,14 +38202,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 173 /* TypeQuery */ || + if (entityName.parent.kind === 172 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155 /* ComputedPropertyName */) { + entityName.parent.kind === 154 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || - entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || + entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38229,10 +38258,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38352,23 +38381,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* StringKeyword */); + return ts.createKeywordTypeNode(143 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* NumberKeyword */); + return ts.createKeywordTypeNode(140 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152 /* BigIntKeyword */); + return ts.createKeywordTypeNode(151 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129 /* BooleanKeyword */); + return ts.createKeywordTypeNode(128 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38409,7 +38438,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38417,7 +38446,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38425,15 +38454,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138 /* NeverKeyword */); + return ts.createKeywordTypeNode(137 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145 /* SymbolKeyword */); + return ts.createKeywordTypeNode(144 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142 /* ObjectKeyword */); + return ts.createKeywordTypeNode(141 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38482,7 +38511,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38509,11 +38538,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728 /* Awaited */) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); - } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38558,7 +38582,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38588,7 +38612,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; + return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38639,12 +38663,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); return signatureNode; } } @@ -38665,7 +38689,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38679,12 +38703,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38779,11 +38803,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38860,7 +38884,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38877,7 +38901,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38886,8 +38910,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38938,7 +38962,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38951,7 +38975,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38965,7 +38989,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -39009,9 +39033,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -39023,7 +39047,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -39042,7 +39066,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192 /* BindingElement */) { + if (clone.kind === 191 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -39183,7 +39207,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39489,8 +39513,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39829,8 +39853,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39945,7 +39969,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -40038,7 +40062,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -40070,7 +40094,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -40080,13 +40104,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -40095,24 +40119,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -40120,11 +40144,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 210 /* BinaryExpression */: - case 195 /* PropertyAccessExpression */: + case 209 /* BinaryExpression */: + case 194 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40345,17 +40369,17 @@ var ts; return result; function visitExistingNodeTreeSymbols(node) { // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 302 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40624,8 +40648,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); - if (node.kind === 248 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); + if (node.kind === 247 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40633,11 +40657,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 /* ModuleBlock */ && + node.parent.kind === 250 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40696,17 +40720,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40723,28 +40747,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 245 /* FunctionDeclaration */: - case 249 /* EnumDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 248 /* EnumDeclaration */: + case 253 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40752,54 +40776,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 163 /* Constructor */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 157 /* Parameter */: - case 251 /* ModuleBlock */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 170 /* TypeReference */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 183 /* ParenthesizedType */: + case 162 /* Constructor */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 156 /* Parameter */: + case 250 /* ModuleBlock */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 169 /* TypeReference */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 182 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: return false; // Type parameters are always visible - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 291 /* SourceFile */: - case 253 /* NamespaceExportDeclaration */: + case 290 /* SourceFile */: + case 252 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return false; default: return false; @@ -40808,10 +40832,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 264 /* ExportSpecifier */) { + else if (node.parent.kind === 263 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40914,12 +40938,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 244 /* VariableDeclarationList */: - case 259 /* ImportSpecifier */: - case 258 /* NamedImports */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 242 /* VariableDeclaration */: + case 243 /* VariableDeclarationList */: + case 258 /* ImportSpecifier */: + case 257 /* NamedImports */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: return false; default: return true; @@ -40952,7 +40976,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -41006,7 +41030,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -41021,23 +41045,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ancestor.initializer; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { + if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -41063,7 +41087,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 190 /* ObjectBindingPattern */) { + if (pattern.kind === 189 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -41136,7 +41160,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -41146,11 +41170,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -41169,7 +41193,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -41183,11 +41207,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157 /* Parameter */) { + if (declaration.kind === 156 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); + if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41402,9 +41426,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 163 /* Constructor */ || - thisContainer.kind === 245 /* FunctionDeclaration */ || - (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 /* Constructor */ || + thisContainer.kind === 244 /* FunctionDeclaration */ || + (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41488,7 +41512,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41512,7 +41536,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 /* ObjectBindingPattern */ + return pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41551,7 +41575,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41609,7 +41633,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260 /* ExportAssignment */) { + if (declaration.kind === 259 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41680,7 +41704,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41714,15 +41738,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41790,9 +41814,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 /* BinaryExpression */ || + else if (declaration.kind === 209 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210 /* BinaryExpression */) { + declaration.parent.kind === 209 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41859,7 +41883,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41958,36 +41982,36 @@ var ts; return undefined; } switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: - case 316 /* JSDocCallbackTag */: - case 187 /* MappedType */: - case 181 /* ConditionalType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 186 /* MappedType */: + case 180 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187 /* MappedType */) { + if (node.kind === 186 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181 /* ConditionalType */) { + else if (node.kind === 180 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41995,7 +42019,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -42005,9 +42029,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 246 /* ClassDeclaration */ || - node.kind === 215 /* ClassExpression */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || + node.kind === 214 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42225,7 +42249,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42261,7 +42285,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */) { + if (declaration.kind === 246 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42349,7 +42373,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210 /* BinaryExpression */) { + else if (expr.kind === 209 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42364,12 +42388,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42383,7 +42407,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42410,7 +42434,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42483,22 +42507,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: - case 188 /* LiteralType */: + case 137 /* NeverKeyword */: + case 187 /* LiteralType */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isThislessType(node.elementType); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42524,7 +42548,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42540,14 +42564,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -43463,8 +43487,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 185 /* TypeOperator */ && - constraintDeclaration.operator === 135 /* KeyOfKeyword */; + return constraintDeclaration.kind === 184 /* TypeOperator */ && + constraintDeclaration.operator === 134 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43689,7 +43713,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432 /* Instantiable */) { + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43725,7 +43749,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43827,10 +43851,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728 /* Awaited */) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43902,7 +43922,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -44190,10 +44210,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 300 /* JSDocOptionalType */ + node.type && node.type.kind === 299 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44227,7 +44247,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44309,7 +44329,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188 /* LiteralType */) { + if (type && type.kind === 187 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -44322,16 +44342,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && + if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 /* Constructor */ ? + var classType = declaration.kind === 162 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44396,11 +44416,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return node.name.kind === 155 /* ComputedPropertyName */ + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return node.name.kind === 154 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44472,7 +44492,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 /* ThisType */ ? + return parameterName.kind === 183 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44515,7 +44535,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163 /* Constructor */) { + if (declaration.kind === 162 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44525,12 +44545,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44620,7 +44640,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; + var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44634,7 +44654,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44668,13 +44688,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182 /* InferType */) { + if (declaration.parent.kind === 181 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 170 /* TypeReference */) { + if (grandParent.kind === 169 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44699,7 +44719,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44724,7 +44744,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44733,7 +44753,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44813,8 +44833,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44858,7 +44878,7 @@ var ts; return errorType; } } - if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44903,9 +44923,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44972,7 +44992,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44998,7 +45018,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -45007,9 +45027,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -45020,7 +45040,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -45133,9 +45153,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return declaration; } } @@ -45256,19 +45276,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { + if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45277,15 +45297,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183 /* ParenthesizedType */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 186 /* IndexedAccessType */: - case 181 /* ConditionalType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 185 /* IndexedAccessType */: + case 180 /* ConditionalType */: + case 184 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } return false; @@ -45294,27 +45314,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; - case 185 /* TypeOperator */: - return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 300 /* JSDocOptionalType */: - case 298 /* JSDocNullableType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 184 /* TypeOperator */: + return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 299 /* JSDocOptionalType */: + case 297 /* JSDocNullableType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 178 /* RestType */: - return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 177 /* RestType */: + return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 178 /* UnionType */: + case 179 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45328,18 +45348,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45444,7 +45464,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 201064448 /* StructuredOrInstantiable */) + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45576,7 +45596,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45930,7 +45950,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45952,24 +45972,20 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ + case 147 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128 /* AwaitedKeyword */: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -46004,13 +46020,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -46021,7 +46037,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -46158,9 +46174,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -46171,7 +46187,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -46181,7 +46197,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -46234,7 +46250,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 197394432 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46306,7 +46322,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46619,7 +46635,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46866,7 +46882,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46902,88 +46918,88 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return anyType; - case 149 /* UnknownKeyword */: + case 148 /* UnknownKeyword */: return unknownType; - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return stringType; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return numberType; - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return bigintType; - case 129 /* BooleanKeyword */: + case 128 /* BooleanKeyword */: return booleanType; - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return neverType; - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getTypeFromTypeReference(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 183 /* ParenthesizedType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 182 /* ParenthesizedType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 178 /* RestType */: + case 177 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 182 /* InferType */: + case 181 /* InferType */: return getTypeFromInferTypeNode(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47191,9 +47207,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 /* QualifiedName */ || - node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 /* QualifiedName */ || + node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -47202,7 +47218,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47211,12 +47227,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -47248,7 +47264,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -47366,7 +47382,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { return getMappedType(type, mapper); @@ -47414,9 +47429,6 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728 /* Awaited */) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432 /* Substitution */) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { @@ -47458,35 +47470,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274 /* JsxAttribute */: { + case 273 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277 /* JsxExpression */: { + case 276 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47505,7 +47517,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47518,7 +47530,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47571,7 +47583,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47621,23 +47633,23 @@ var ts; return true; } switch (node.kind) { - case 277 /* JsxExpression */: - case 201 /* ParenthesizedExpression */: + case 276 /* JsxExpression */: + case 200 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47828,7 +47840,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47837,9 +47849,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47990,11 +48002,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165 /* SetAccessor */: return [3 /*break*/, 2]; - case 164 /* GetAccessor */: return [3 /*break*/, 2]; - case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 164 /* SetAccessor */: return [3 /*break*/, 2]; + case 163 /* GetAccessor */: return [3 /*break*/, 2]; + case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -48071,8 +48083,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && - kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && + kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48333,7 +48345,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48743,7 +48755,7 @@ var ts; result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } } - if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -49108,8 +49120,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -49236,17 +49247,6 @@ var ts; } } } - else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - // An `awaited S` is related to an `awaited T` if `S` is related to `T`: - // - // S <: T ⇒ awaited S <: awaited T - // - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49364,21 +49364,6 @@ var ts; } } } - else if (source.flags & 134217728 /* Awaited */) { - // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the - // constraint of `S`: - // - // S <: C ^ awaited C <: T ⇒ awaited S <: T - // - // For example `awaited Promise` is assignable to `number`. - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -50230,11 +50215,13 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } } variances.push(variance); }; @@ -51007,12 +50994,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210 /* BinaryExpression */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 209 /* BinaryExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157 /* Parameter */: + case 156 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -51027,23 +51014,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -51057,7 +51044,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187 /* MappedType */: + case 186 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -51185,7 +51172,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 197394432 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51481,7 +51468,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 197394432 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51516,9 +51503,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51526,10 +51510,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728 /* Awaited */) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51543,7 +51523,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51655,34 +51635,10 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576 /* Union */) { var nakedTypeVariable = void 0; - for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { - var t = targets_2[_i]; - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - } - // To better support backwards compatibility with the new `awaited` type, we detect a target - // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, - // we infer from source to the type parameter `T`, where each type of source is mapped to extract - // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } var sources = source.flags & 1048576 /* Union */ ? source.types : [source]; var matched_1 = new Array(sources.length); var inferenceCircularity = false; @@ -51690,9 +51646,13 @@ var ts; // track whether inferences were made from that particular type to some target with // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t = targets_2[_i]; + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512 /* MaxValue */; @@ -51730,8 +51690,8 @@ var ts; // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -51745,8 +51705,8 @@ var ts; // we want to infer string for T, not Promise | string. For intersection types // we only infer to single naked type variables. if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1 /* NakedTypeVariable */); } @@ -51903,7 +51863,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; + bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -52073,7 +52033,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -52094,7 +52054,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -52109,11 +52069,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -52124,24 +52084,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201 /* ParenthesizedExpression */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && + (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -52151,11 +52111,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -52184,7 +52144,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -52217,7 +52177,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -52335,7 +52295,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 197394432 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52372,15 +52332,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52397,21 +52357,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return stringType; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return undefinedType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52419,7 +52379,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 /* ObjectBindingPattern */ ? + var type = pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52437,30 +52397,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232 /* ForInStatement */) { + if (node.parent.parent.kind === 231 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.parent.kind === 232 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 /* VariableDeclaration */ ? + return node.kind === 242 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 /* VariableDeclaration */ && node.initializer && + return node.kind === 242 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && + node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52472,13 +52432,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 /* ParenthesizedExpression */ || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 200 /* ParenthesizedExpression */ || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52498,7 +52458,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52660,12 +52620,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 /* CallExpression */ + parent.parent.kind === 196 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 210 /* BinaryExpression */ && + parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52673,8 +52633,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || - declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && + return (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || + declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52687,7 +52647,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, /*diagnostic*/ undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -52713,11 +52673,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52731,7 +52691,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52775,7 +52735,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52850,7 +52810,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52862,7 +52822,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52943,8 +52903,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 195 /* PropertyAccessExpression */ && - reference.kind !== 196 /* ElementAccessExpression */ && + reference.kind !== 194 /* PropertyAccessExpression */ && + reference.kind !== 195 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52969,7 +52929,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -53009,14 +52969,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { + if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -53027,7 +52987,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -53058,7 +53018,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 /* CallExpression */ ? + var expr = node.kind === 196 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -53066,7 +53026,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -53116,7 +53076,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -53124,7 +53084,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -53336,10 +53296,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -53463,7 +53423,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 210 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 209 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53487,7 +53447,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53557,7 +53517,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53771,16 +53731,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53825,9 +53785,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 /* ModuleBlock */ || - node.kind === 291 /* SourceFile */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 250 /* ModuleBlock */ || + node.kind === 290 /* SourceFile */ || + node.kind === 159 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53849,7 +53809,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { symbol.isAssigned = true; } } @@ -53865,7 +53825,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 /* Parameter */ && + declaration.kind === 156 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53879,13 +53839,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 /* PropertyAccessExpression */ || - parent.kind === 197 /* CallExpression */ && parent.expression === node || - parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 194 /* PropertyAccessExpression */ || + parent.kind === 196 /* CallExpression */ && parent.expression === node || + parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53924,7 +53884,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { 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 /* Async */)) { @@ -53945,7 +53905,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 246 /* ClassDeclaration */ + if (declaration.kind === 245 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53957,14 +53917,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215 /* ClassExpression */) { + else if (declaration.kind === 214 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 291 /* SourceFile */) { + while (container.kind !== 290 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -54013,7 +53973,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -54022,8 +53982,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || - flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || + flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -54032,9 +53992,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || - node.parent.kind === 219 /* NonNullExpression */ || - declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || + node.parent.kind === 218 /* NonNullExpression */ || + declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -54069,7 +54029,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -54092,7 +54052,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -54113,7 +54073,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -54132,7 +54092,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 201 /* ParenthesizedExpression */) { + while (current.parent.kind === 200 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -54140,7 +54100,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -54153,7 +54113,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { + if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -54221,37 +54181,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 163 /* Constructor */) { + if (container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 163 /* Constructor */: + case 162 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -54301,7 +54261,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && + (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -54348,7 +54308,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 202 /* FunctionExpression */ && + if (container.kind === 201 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -54358,16 +54318,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 162 /* MethodDeclaration */ && - container.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 161 /* MethodDeclaration */ && + container.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 202 /* FunctionExpression */ && - container.parent.kind === 282 /* PropertyAssignment */ && - container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && + container.parent.kind === 281 /* PropertyAssignment */ && + container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -54375,7 +54335,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 202 /* FunctionExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -54400,7 +54360,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -54414,15 +54374,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 203 /* ArrowFunction */) { + while (container && container.kind === 202 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54435,14 +54395,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); - if (current && current.kind === 155 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); + if (current && current.kind === 154 /* ComputedPropertyName */) { 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 === 194 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54450,7 +54410,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163 /* Constructor */) { + if (!isCallExpression && container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54519,7 +54479,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54533,7 +54493,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (container.parent.kind === 193 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54554,7 +54514,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54569,7 +54529,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 163 /* Constructor */; + return container.kind === 162 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54577,21 +54537,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */; } else { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */ || - container.kind === 160 /* PropertyDeclaration */ || - container.kind === 159 /* PropertySignature */ || - container.kind === 163 /* Constructor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */ || + container.kind === 159 /* PropertyDeclaration */ || + container.kind === 158 /* PropertySignature */ || + container.kind === 162 /* Constructor */; } } } @@ -54599,10 +54559,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 /* MethodDeclaration */ || - func.kind === 164 /* GetAccessor */ || - func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 161 /* MethodDeclaration */ || + func.kind === 163 /* GetAccessor */ || + func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54614,7 +54574,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54641,7 +54601,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282 /* PropertyAssignment */) { + if (literal.parent.kind !== 281 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54655,7 +54615,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54708,9 +54668,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157 /* Parameter */: + case 156 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54719,7 +54679,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54760,9 +54720,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54774,9 +54731,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54847,7 +54801,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199 /* TaggedTemplateExpression */) { + if (template.parent.kind === 198 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -55083,21 +55037,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return true; - case 195 /* PropertyAccessExpression */: - case 201 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 200 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -55122,7 +55076,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -55145,7 +55099,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -55183,58 +55137,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 191 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 203 /* ArrowFunction */: - case 236 /* ReturnStatement */: + case 202 /* ArrowFunction */: + case 235 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 198 /* NewExpression */: + case 197 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193 /* ArrayLiteralExpression */: { + case 192 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); + case 221 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -55391,7 +55345,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; + return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -55405,7 +55359,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55450,8 +55404,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 /* BindingElement */ && !!node.initializer) || - (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 191 /* BindingElement */ && !!node.initializer) || + (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55464,7 +55418,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 /* SpreadElement */ && e.expression; + var spread = e.kind === 213 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55550,7 +55504,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55641,7 +55595,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55655,13 +55609,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 /* PropertyAssignment */ || - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 281 /* PropertyAssignment */ || + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55684,8 +55638,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55711,7 +55665,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284 /* SpreadAssignment */) { + else if (memberDecl.kind === 283 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55740,7 +55694,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55765,7 +55719,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55807,13 +55761,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55909,7 +55863,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55935,7 +55889,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -56365,7 +56319,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56524,7 +56478,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201 /* ParenthesizedExpression */) { + while (node.parent.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56677,7 +56631,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56709,8 +56663,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && - node.parent.kind !== 170 /* TypeReference */ && + else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && + node.parent.kind !== 169 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56722,22 +56676,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return true; - case 282 /* PropertyAssignment */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 284 /* SpreadAssignment */: - case 155 /* ComputedPropertyName */: - case 222 /* TemplateSpan */: - case 277 /* JsxExpression */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 269 /* JsxOpeningElement */: - case 217 /* ExpressionWithTypeArguments */: - case 280 /* HeritageClause */: + case 281 /* PropertyAssignment */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 283 /* SpreadAssignment */: + case 154 /* ComputedPropertyName */: + case 221 /* TemplateSpan */: + case 276 /* JsxExpression */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 268 /* JsxOpeningElement */: + case 216 /* ExpressionWithTypeArguments */: + case 279 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56926,16 +56880,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 189 /* ImportType */: + case 188 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56958,7 +56912,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer.kind === 243 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56987,7 +56941,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 /* ForInStatement */ && + if (node.kind === 231 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -57071,13 +57025,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158 /* Decorator */) { + else if (node.kind !== 157 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -57141,7 +57095,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -57155,9 +57109,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 212 /* TemplateExpression */) { + if (node.template.kind === 211 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -57172,7 +57126,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158 /* Decorator */) { + else if (node.kind === 157 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -57187,7 +57141,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 198 /* NewExpression */); + ts.Debug.assert(node.kind === 197 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -57280,7 +57234,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 158 /* Decorator */) { + if (node.kind !== 157 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -57323,7 +57277,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -57337,7 +57291,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -57347,7 +57301,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 221 /* SyntheticExpression */ ? + return arg.kind === 220 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57502,7 +57456,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57532,7 +57486,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57573,7 +57527,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57581,7 +57535,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57591,17 +57545,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158 /* Decorator */) { + if (node.kind === 157 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57631,30 +57585,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157 /* Parameter */: + case 156 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57668,17 +57622,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 1; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return 2; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 157 /* Parameter */: + case 156 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57803,8 +57757,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 158 /* Decorator */; + var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 157 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57866,7 +57820,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -58382,7 +58336,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 163 /* Constructor */) { + if (!modifiers || declaration.kind !== 162 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58513,16 +58467,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58613,16 +58567,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158 /* Decorator */: + case 157 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58711,7 +58665,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195 /* PropertyAccessExpression */) { + while (parent && parent.kind === 194 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58736,12 +58690,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 198 /* NewExpression */) { + if (node.kind === 197 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 /* Constructor */ && - declaration.kind !== 167 /* ConstructSignature */ && - declaration.kind !== 172 /* ConstructorType */ && + declaration.kind !== 162 /* Constructor */ && + declaration.kind !== 166 /* ConstructSignature */ && + declaration.kind !== 171 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58761,7 +58715,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && + if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58868,9 +58822,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 245 /* FunctionDeclaration */ + ? 244 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 243 /* VariableDeclaration */ + ? 242 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58898,18 +58852,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return true; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58940,8 +58894,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -58959,7 +58919,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163 /* Constructor */) { + else if (container.kind === 162 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -59185,7 +59145,7 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -59195,7 +59155,7 @@ var ts; var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -59226,7 +59186,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -59413,7 +59373,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205 /* TypeOfExpression */) { + if (node.expression.kind === 204 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -59472,11 +59432,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 162 /* MethodDeclaration */: - return func.parent.kind === 194 /* ObjectLiteralExpression */; + case 161 /* MethodDeclaration */: + return func.parent.kind === 193 /* ObjectLiteralExpression */; default: return false; } @@ -59502,7 +59462,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59535,7 +59495,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59559,7 +59519,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59612,7 +59572,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59625,7 +59585,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224 /* Block */) { + if (node.body.kind === 223 /* Block */) { checkSourceElement(node.body); } else { @@ -59715,7 +59675,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163 /* Constructor */)) { + if (!(ctor && ctor.kind === 162 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59740,7 +59700,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257 /* NamespaceImport */; + return !!declaration && declaration.kind === 256 /* NamespaceImport */; } } } @@ -59748,7 +59708,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { // References are combinations of identifiers, parentheses, and property accesses. - var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); + var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 75 /* Identifier */ && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -59766,7 +59726,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59816,7 +59776,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59988,7 +59948,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -60008,7 +59968,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -60021,9 +59981,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 284 /* SpreadAssignment */) { + else if (property.kind === 283 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -60066,8 +60026,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216 /* OmittedExpression */) { - if (element.kind !== 214 /* SpreadElement */) { + if (element.kind !== 215 /* OmittedExpression */) { + if (element.kind !== 213 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -60085,7 +60045,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -60101,7 +60061,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -60117,24 +60077,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194 /* ObjectLiteralExpression */) { + if (target.kind === 193 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193 /* ArrayLiteralExpression */) { + if (target.kind === 192 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 /* SpreadAssignment */ ? + var error = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -60159,36 +60119,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 199 /* TaggedTemplateExpression */: - case 212 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 147 /* UndefinedKeyword */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 205 /* TypeOfExpression */: - case 219 /* NonNullExpression */: - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: + case 146 /* UndefinedKeyword */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 204 /* TypeOfExpression */: + case 218 /* NonNullExpression */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: return true; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -60200,9 +60160,9 @@ var ts; } return false; // Some forms listed here for clarity - case 206 /* VoidExpression */: // Explicit opt-out - case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 205 /* VoidExpression */: // Explicit opt-out + case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -60234,7 +60194,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -60301,7 +60261,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60706,7 +60666,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60755,13 +60715,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; + return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60771,7 +60731,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60800,7 +60760,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60837,7 +60797,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60848,7 +60808,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -61082,11 +61042,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums 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_or_type_query); } @@ -61111,9 +61071,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -61139,78 +61099,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return checkQualifiedName(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checkCallExpression(node, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return checkClassExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return checkAssertion(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return checkNonNullAssertion(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return checkMetaProperty(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkDeleteExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return checkVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return checkAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return undefinedWideningType; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return checkYieldExpression(node); - case 221 /* SyntheticExpression */: + case 220 /* SyntheticExpression */: return node.type; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return checkJsxElement(node, checkMode); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return checkJsxFragment(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -61247,10 +61207,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -61261,13 +61221,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { + if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + if (func.kind === 163 /* GetAccessor */ || func.kind === 164 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -61325,13 +61285,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203 /* ArrowFunction */: - case 166 /* CallSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 171 /* FunctionType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 202 /* ArrowFunction */: + case 165 /* CallSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 170 /* FunctionType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -61349,7 +61309,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { + else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -61358,13 +61318,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || - node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || - node.kind === 167 /* ConstructSignature */) { + else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || + node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || + node.kind === 166 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -61394,10 +61354,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -61427,7 +61387,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { + if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -61439,7 +61399,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163 /* Constructor */) { + if (member.kind === 162 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -61459,16 +61419,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61531,7 +61491,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159 /* PropertySignature */) { + if (member.kind === 158 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61556,7 +61516,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61576,7 +61536,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61584,7 +61544,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61626,7 +61586,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61654,7 +61614,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 /* PropertyDeclaration */ && + return n.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61684,7 +61644,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61709,7 +61669,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61719,7 +61679,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61728,7 +61688,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61746,7 +61706,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61794,7 +61754,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61839,7 +61799,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178 /* RestType */) { + if (e.kind === 177 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61848,7 +61808,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177 /* OptionalType */) { + else if (e.kind === 176 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61869,7 +61829,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61920,7 +61880,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61937,9 +61897,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 247 /* InterfaceDeclaration */ && - n.parent.kind !== 246 /* ClassDeclaration */ && - n.parent.kind !== 215 /* ClassExpression */ && + if (n.parent.kind !== 246 /* InterfaceDeclaration */ && + n.parent.kind !== 245 /* ClassDeclaration */ && + n.parent.kind !== 214 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -62035,7 +61995,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && + var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -62075,7 +62035,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -62086,10 +62046,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { + if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -62220,25 +62180,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return 2 /* ExportType */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -62246,17 +62206,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 245 /* FunctionDeclaration */: - case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 244 /* FunctionDeclaration */: + case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -62296,9 +62256,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { @@ -62335,28 +62294,6 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - /** - * Gets or creates an `awaited T` type for a generic type. - * - * The "awaited type" of a generic type cannot be determined until it is instantiated. As - * a result, an `AwaitedType` for the generic type is created that can be instantiated - * or related later. - */ - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728 /* Awaited */); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; - } /** * Determines whether a type has a callable `then` member. */ @@ -62364,32 +62301,6 @@ var ts; var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; } - /** - * Determines whether a type is a generic type whose base constraint could possibly resolve to a different - * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: - * - The type is a generic object type, - * - AND one of the following conditions are met - * - The type has no base constraint, - * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, - * - OR The base constraint has a callable `then` member. - * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a - * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound - * behavior is much more developer friendly. - */ - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152 /* Intersection */) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } /** * Gets the "awaited type" of a type. * @@ -62398,60 +62309,22 @@ var ts; * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a * non-promise type is found. * - * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` - * type. + * This is used to reflect the runtime behavior of the `await` keyword. */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } // For a union, get a union of the awaited types of each constituent. // - // For example: - // - // awaited (number | string) -> number | string - // awaited (number | Promise) -> number | string - // awaited (T | string) -> awaited T | string - // awaited (T | Promise) -> awaited T | string - // awaited (T | Promise) -> awaited T - // awaited (T | U) -> awaited T | awaited U - // return typeAsAwaitable.awaitedTypeOfType = mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } - // We cannot resolve the awaited type for a type variable until it is instantiated. As - // such, we create an `awaited T` type that can either be instantiated or related later. - // - // For example: - // - // T -> awaited T - // - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -62635,24 +62508,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157 /* Parameter */: + case 156 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62699,14 +62572,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; } } @@ -62715,13 +62588,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62767,14 +62640,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62783,23 +62656,23 @@ var ts; } } break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157 /* Parameter */: + case 156 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62862,7 +62735,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62903,7 +62776,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62916,7 +62789,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62945,7 +62818,7 @@ var ts; } } } - var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62987,42 +62860,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291 /* SourceFile */: - case 250 /* ModuleDeclaration */: - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 290 /* SourceFile */: + case 249 /* ModuleDeclaration */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182 /* InferType */: + case 181 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -63042,11 +62915,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162 /* MethodDeclaration */: - case 160 /* PropertyDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 161 /* MethodDeclaration */: + case 159 /* PropertyDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -63057,7 +62930,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -63065,8 +62938,8 @@ var ts; } } break; - case 168 /* IndexSignature */: - case 223 /* SemicolonClassElement */: + case 167 /* IndexSignature */: + case 222 /* SemicolonClassElement */: // Can't be private break; default: @@ -63093,7 +62966,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -63176,7 +63049,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -63194,7 +63067,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -63215,7 +63088,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -63229,22 +63102,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; + return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 224 /* Block */) { + if (node.kind === 223 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -63274,12 +63147,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 /* PropertyDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 162 /* MethodDeclaration */ || - node.kind === 161 /* MethodSignature */ || - node.kind === 164 /* GetAccessor */ || - node.kind === 165 /* SetAccessor */) { + if (node.kind === 159 /* PropertyDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 161 /* MethodDeclaration */ || + node.kind === 160 /* MethodSignature */ || + node.kind === 163 /* GetAccessor */ || + node.kind === 164 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -63288,7 +63161,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -63345,7 +63218,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63360,7 +63233,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63395,7 +63268,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -63407,17 +63280,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 251 /* ModuleBlock */ || - container.kind === 250 /* ModuleDeclaration */ || - container.kind === 291 /* SourceFile */); + (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 250 /* ModuleBlock */ || + container.kind === 249 /* ModuleDeclaration */ || + container.kind === 290 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -63447,18 +63320,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192 /* BindingElement */) { - if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 191 /* BindingElement */) { + if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -63479,19 +63352,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -63528,7 +63401,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -63554,10 +63427,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { + if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -63569,7 +63442,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ + var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63579,8 +63452,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || - (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { + if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || + (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63620,7 +63493,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225 /* EmptyStatement */) { + if (node.thenStatement.kind === 224 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63691,12 +63564,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63730,14 +63603,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63769,7 +63642,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { 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); @@ -63783,7 +63656,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63796,7 +63669,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -64436,7 +64309,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -64458,12 +64331,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165 /* SetAccessor */) { + if (func.kind === 164 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163 /* Constructor */) { + else if (func.kind === 162 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -64471,7 +64344,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -64481,7 +64354,7 @@ var ts; } } } - else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -64510,7 +64383,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -64519,7 +64392,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -64551,7 +64424,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64658,8 +64531,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 /* BinaryExpression */ || - name.kind === 155 /* ComputedPropertyName */ || + (propDeclaration.kind === 209 /* BinaryExpression */ || + name.kind === 154 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64736,7 +64609,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170 /* TypeReference */) { + if (node.kind === 169 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64982,7 +64855,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; + return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -65037,7 +64910,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215 /* ClassExpression */) { + if (derivedClassDecl.kind === 214 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -65059,7 +64932,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -65074,7 +64947,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -65171,7 +65044,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 /* PropertyDeclaration */ && + return node.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -65195,7 +65068,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -65301,7 +65174,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -65311,7 +65184,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -65340,7 +65213,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -65348,14 +65221,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 195 /* PropertyAccessExpression */) { + if (ex.kind === 194 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -65385,8 +65258,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -65422,7 +65295,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 249 /* EnumDeclaration */) { + if (declaration.kind !== 248 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -65450,8 +65323,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 /* ClassDeclaration */ || - (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 /* ClassDeclaration */ || + (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -65514,7 +65387,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -65564,23 +65437,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192 /* BindingElement */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 242 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65591,12 +65464,12 @@ var ts; break; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 245 /* FunctionDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65619,12 +65492,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65644,9 +65517,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65681,14 +65554,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 /* ExportSpecifier */ ? + var message = node.kind === 263 /* ExportSpecifier */ ? 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)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 264 /* ExportSpecifier */ + && node.kind === 263 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65716,7 +65589,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65740,7 +65613,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65785,10 +65658,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65806,14 +65679,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65869,8 +65742,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65984,165 +65857,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return checkTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return checkParameter(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return checkPropertySignature(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return checkSignatureDeclaration(node); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return checkMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return checkConstructorDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return checkAccessorDeclaration(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return checkTypeReferenceNode(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return checkTypePredicate(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return checkTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return checkTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return checkArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return checkTupleType(node); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 178 /* RestType */: + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 177 /* RestType */: return checkSourceElement(node.type); - case 184 /* ThisType */: + case 183 /* ThisType */: return checkThisType(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return checkTypeOperator(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return checkConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return checkInferType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return checkImportType(node); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: - case 305 /* JSDocTypeLiteral */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: + case 304 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 295 /* JSDocTypeExpression */: + case 294 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return checkMappedType(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return checkBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return checkVariableStatement(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return checkExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return checkIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return checkDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return checkWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return checkForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return checkForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkForOfStatement(node); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return checkReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return checkSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return checkThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return checkTryStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return checkBindingElement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return checkClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return checkImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return checkExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return checkExportAssignment(node); - case 225 /* EmptyStatement */: - case 242 /* DebuggerStatement */: + case 224 /* EmptyStatement */: + case 241 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -66237,33 +66110,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: - case 269 /* JsxOpeningElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: + case 268 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 267 /* JsxElement */: + case 266 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -66406,17 +66279,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -66424,8 +66297,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -66434,7 +66307,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -66482,16 +66355,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156 /* TypeParameter */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 155 /* TypeParameter */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return true; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -66499,16 +66372,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 170 /* TypeReference */; + return node.parent.kind === 169 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195 /* PropertyAccessExpression */) { + while (node.parent.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 217 /* ExpressionWithTypeArguments */; + return node.parent.kind === 216 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -66536,13 +66409,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -66568,7 +66441,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66578,7 +66451,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 /* PropertyAccessExpression */ && + name.parent.kind === 194 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66588,7 +66461,7 @@ var ts; } } } - if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66598,7 +66471,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66616,7 +66489,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66632,10 +66505,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318 /* JSDocParameterTag */) { + if (name.parent.kind === 317 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { + if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66652,12 +66525,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { + else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195 /* PropertyAccessExpression */) { + if (name.kind === 194 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66667,17 +66540,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 169 /* TypePredicate */) { + if (name.parent.kind === 168 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66700,8 +66573,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 /* BindingElement */ && - grandParent.kind === 190 /* ObjectBindingPattern */ && + else if (parent.kind === 191 /* BindingElement */ && + grandParent.kind === 189 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66713,8 +66586,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66728,14 +66601,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 184 /* ThisType */: + case 183 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66746,7 +66619,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66768,7 +66641,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66777,7 +66650,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66848,23 +66721,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 233 /* ForOfStatement */) { + if (expr.parent.kind === 232 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 210 /* BinaryExpression */) { + if (expr.parent.kind === 209 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 282 /* PropertyAssignment */) { + if (expr.parent.kind === 281 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66912,7 +66785,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66968,7 +66841,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -67024,7 +66897,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -67052,7 +66925,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -67083,7 +66956,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -67124,19 +66997,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -67145,7 +67018,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -67247,15 +67120,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285 /* EnumMember */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 284 /* EnumMember */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285 /* EnumMember */) { + if (node.kind === 284 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -67496,12 +67369,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; + var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -67517,7 +67390,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -67526,7 +67399,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; + return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -67538,7 +67411,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67589,7 +67462,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67617,12 +67490,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67814,14 +67687,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 /* MethodDeclaration */ && !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 === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { + else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { 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); @@ -67838,17 +67711,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139 /* ReadonlyKeyword */) { - if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { + if (modifier.kind !== 138 /* ReadonlyKeyword */) { + if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 249 /* EnumDeclaration */) { + if (node.kind !== 248 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67868,7 +67741,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67894,10 +67767,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67909,11 +67782,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { + else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67936,19 +67809,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67958,10 +67831,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67974,14 +67847,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246 /* ClassDeclaration */) { - if (node.kind !== 162 /* MethodDeclaration */ && - node.kind !== 160 /* PropertyDeclaration */ && - node.kind !== 164 /* GetAccessor */ && - node.kind !== 165 /* SetAccessor */) { + if (node.kind !== 245 /* ClassDeclaration */) { + if (node.kind !== 161 /* MethodDeclaration */ && + node.kind !== 159 /* PropertyDeclaration */ && + node.kind !== 163 /* GetAccessor */ && + node.kind !== 164 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -68003,7 +67876,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -68011,7 +67884,7 @@ var ts; break; } } - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -68026,13 +67899,13 @@ var ts; } return false; } - else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -68053,37 +67926,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 250 /* ModuleDeclaration */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 157 /* Parameter */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 249 /* ModuleDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 156 /* Parameter */: return false; default: - if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return false; } switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 247 /* InterfaceDeclaration */: - case 226 /* VariableStatement */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 225 /* VariableStatement */: + case 247 /* TypeAliasDeclaration */: return true; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -68096,10 +67969,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -68214,7 +68087,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 !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { + if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -68256,7 +68129,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216 /* OmittedExpression */) { + if (arg.kind === 215 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -68333,20 +68206,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 162 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 161 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -68365,7 +68238,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */) { + if (prop.kind === 283 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -68376,11 +68249,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -68393,7 +68266,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -68408,10 +68281,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -68419,13 +68292,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -68464,7 +68337,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276 /* JsxSpreadAttribute */) { + if (attr.kind === 275 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -68474,7 +68347,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -68488,14 +68361,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163 /* Constructor */) { + if (func && func.kind !== 162 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -68506,7 +68379,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -68521,20 +68394,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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); @@ -68559,11 +68432,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165 /* SetAccessor */) { + if (accessor.kind === 164 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68585,21 +68458,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148 /* UniqueKeyword */) { - if (node.type.kind !== 145 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); + if (node.operator === 147 /* UniqueKeyword */) { + if (node.type.kind !== 144 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68611,13 +68484,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68626,9 +68499,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139 /* ReadonlyKeyword */) { - if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); + else if (node.operator === 138 /* ReadonlyKeyword */) { + if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); } } } @@ -68641,8 +68514,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162 /* MethodDeclaration */) { - if (node.parent.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 161 /* MethodDeclaration */) { + if (node.parent.kind === 193 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68670,14 +68543,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68688,11 +68561,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68700,8 +68573,8 @@ var ts; return false; } break; - case 238 /* SwitchStatement */: - if (node.kind === 235 /* BreakStatement */ && !node.label) { + case 237 /* SwitchStatement */: + if (node.kind === 234 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68716,13 +68589,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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 === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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); @@ -68746,12 +68619,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68782,7 +68655,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { + if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68795,7 +68668,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68858,15 +68731,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return false; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68950,7 +68823,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68958,7 +68831,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68987,13 +68860,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 248 /* TypeAliasDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 261 /* ExportDeclaration */ || - node.kind === 260 /* ExportAssignment */ || - node.kind === 253 /* NamespaceExportDeclaration */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 247 /* TypeAliasDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 260 /* ExportDeclaration */ || + node.kind === 259 /* ExportAssignment */ || + node.kind === 252 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -69002,7 +68875,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 === 226 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -69025,7 +68898,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -69047,10 +68920,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -69225,14 +69098,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || + return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -69240,14 +69113,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 256 /* ImportClause */: // For default import - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: // For rename import `x as y` + case 255 /* ImportClause */: // For default import + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 259 /* ImportSpecifier */; + return decl.parent.kind === 258 /* ImportSpecifier */; default: return false; } @@ -69510,7 +69383,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(131 /* DeclareKeyword */)); + result.push(createModifier(130 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -69534,7 +69407,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(139 /* ReadonlyKeyword */)); + result.push(createModifier(138 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -69544,7 +69417,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(154 /* QualifiedName */); + var node = createSynthesizedNode(153 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -69563,7 +69436,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155 /* ComputedPropertyName */); + var node = createSynthesizedNode(154 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69576,7 +69449,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156 /* TypeParameter */); + var node = createSynthesizedNode(155 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69592,7 +69465,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157 /* Parameter */); + var node = createSynthesizedNode(156 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69616,7 +69489,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158 /* Decorator */); + var node = createSynthesizedNode(157 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69629,7 +69502,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertySignature */); + var node = createSynthesizedNode(158 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69649,7 +69522,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160 /* PropertyDeclaration */); + var node = createSynthesizedNode(159 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69673,7 +69546,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69690,7 +69563,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162 /* MethodDeclaration */); + var node = createSynthesizedNode(161 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69750,7 +69623,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163 /* Constructor */); + var node = createSynthesizedNode(162 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69770,7 +69643,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164 /* GetAccessor */); + var node = createSynthesizedNode(163 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69793,7 +69666,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165 /* SetAccessor */); + var node = createSynthesizedNode(164 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69814,7 +69687,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69822,7 +69695,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69830,7 +69703,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168 /* IndexSignature */); + var node = createSynthesizedNode(167 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69874,7 +69747,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169 /* TypePredicate */); + var node = createSynthesizedNode(168 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69894,7 +69767,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170 /* TypeReference */); + var node = createSynthesizedNode(169 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69908,7 +69781,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69916,7 +69789,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69924,7 +69797,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173 /* TypeQuery */); + var node = createSynthesizedNode(172 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69936,7 +69809,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174 /* TypeLiteral */); + var node = createSynthesizedNode(173 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69948,7 +69821,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175 /* ArrayType */); + var node = createSynthesizedNode(174 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69960,7 +69833,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176 /* TupleType */); + var node = createSynthesizedNode(175 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69972,7 +69845,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177 /* OptionalType */); + var node = createSynthesizedNode(176 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69984,7 +69857,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178 /* RestType */); + var node = createSynthesizedNode(177 /* RestType */); node.type = type; return node; } @@ -69996,7 +69869,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -70004,7 +69877,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -70023,7 +69896,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181 /* ConditionalType */); + var node = createSynthesizedNode(180 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -70041,7 +69914,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182 /* InferType */); + var node = createSynthesizedNode(181 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -70053,7 +69926,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189 /* ImportType */); + var node = createSynthesizedNode(188 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -70071,7 +69944,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183 /* ParenthesizedType */); + var node = createSynthesizedNode(182 /* ParenthesizedType */); node.type = type; return node; } @@ -70083,12 +69956,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184 /* ThisType */); + return createSynthesizedNode(183 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; + var node = createSynthesizedNode(184 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -70098,7 +69971,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186 /* IndexedAccessType */); + var node = createSynthesizedNode(185 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -70112,7 +69985,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187 /* MappedType */); + var node = createSynthesizedNode(186 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -70130,7 +70003,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188 /* LiteralType */); + var node = createSynthesizedNode(187 /* LiteralType */); node.literal = literal; return node; } @@ -70143,7 +70016,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ObjectBindingPattern */); + var node = createSynthesizedNode(189 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70155,7 +70028,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191 /* ArrayBindingPattern */); + var node = createSynthesizedNode(190 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70167,7 +70040,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192 /* BindingElement */); + var node = createSynthesizedNode(191 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -70186,7 +70059,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -70200,7 +70073,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -70214,7 +70087,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -70222,10 +70095,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - // Not sure why this cast was necessary: the previous line should already establish that node.name is an identifier - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } // Because we are updating existed propertyAccess we want to inherit its emitFlags // instead of using the default from createPropertyAccess @@ -70236,7 +70107,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70257,7 +70128,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -70274,7 +70145,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70292,7 +70163,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -70311,7 +70182,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70331,7 +70202,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198 /* NewExpression */); + var node = createSynthesizedNode(197 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -70347,7 +70218,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -70370,7 +70241,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200 /* TypeAssertionExpression */); + var node = createSynthesizedNode(199 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -70384,7 +70255,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201 /* ParenthesizedExpression */); + var node = createSynthesizedNode(200 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -70396,7 +70267,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202 /* FunctionExpression */); + var node = createSynthesizedNode(201 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -70420,7 +70291,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203 /* ArrowFunction */); + var node = createSynthesizedNode(202 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -70442,7 +70313,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204 /* DeleteExpression */); + var node = createSynthesizedNode(203 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70454,7 +70325,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205 /* TypeOfExpression */); + var node = createSynthesizedNode(204 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70466,7 +70337,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206 /* VoidExpression */); + var node = createSynthesizedNode(205 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70478,7 +70349,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207 /* AwaitExpression */); + var node = createSynthesizedNode(206 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70490,7 +70361,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -70503,7 +70374,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -70516,7 +70387,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210 /* BinaryExpression */); + var node = createSynthesizedNode(209 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -70533,7 +70404,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211 /* ConditionalExpression */); + var node = createSynthesizedNode(210 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -70553,7 +70424,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212 /* TemplateExpression */); + var node = createSynthesizedNode(211 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70650,7 +70521,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213 /* YieldExpression */); + var node = createSynthesizedNode(212 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70664,7 +70535,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214 /* SpreadElement */); + var node = createSynthesizedNode(213 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70676,7 +70547,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215 /* ClassExpression */); + var node = createSynthesizedNode(214 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70697,11 +70568,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216 /* OmittedExpression */); + return createSynthesizedNode(215 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70715,7 +70586,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218 /* AsExpression */); + var node = createSynthesizedNode(217 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70729,19 +70600,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219 /* NonNullExpression */); + var node = createSynthesizedNode(218 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218 /* NonNullExpression */); + node.flags |= 32 /* OptionalChain */; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220 /* MetaProperty */); + var node = createSynthesizedNode(219 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70755,7 +70643,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222 /* TemplateSpan */); + var node = createSynthesizedNode(221 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70769,12 +70657,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223 /* SemicolonClassElement */); + return createSynthesizedNode(222 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224 /* Block */); + var block = createSynthesizedNode(223 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70788,7 +70676,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226 /* VariableStatement */); + var node = createSynthesizedNode(225 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70803,11 +70691,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225 /* EmptyStatement */); + return createSynthesizedNode(224 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227 /* ExpressionStatement */); + var node = createSynthesizedNode(226 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70823,7 +70711,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228 /* IfStatement */); + var node = createSynthesizedNode(227 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70839,7 +70727,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229 /* DoStatement */); + var node = createSynthesizedNode(228 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70853,7 +70741,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230 /* WhileStatement */); + var node = createSynthesizedNode(229 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70867,7 +70755,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231 /* ForStatement */); + var node = createSynthesizedNode(230 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70885,7 +70773,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForInStatement */); + var node = createSynthesizedNode(231 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70901,7 +70789,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233 /* ForOfStatement */); + var node = createSynthesizedNode(232 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70919,7 +70807,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234 /* ContinueStatement */); + var node = createSynthesizedNode(233 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70931,7 +70819,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235 /* BreakStatement */); + var node = createSynthesizedNode(234 /* BreakStatement */); node.label = asName(label); return node; } @@ -70943,7 +70831,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236 /* ReturnStatement */); + var node = createSynthesizedNode(235 /* ReturnStatement */); node.expression = expression; return node; } @@ -70955,7 +70843,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237 /* WithStatement */); + var node = createSynthesizedNode(236 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70969,7 +70857,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238 /* SwitchStatement */); + var node = createSynthesizedNode(237 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70983,7 +70871,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239 /* LabeledStatement */); + var node = createSynthesizedNode(238 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70997,7 +70885,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240 /* ThrowStatement */); + var node = createSynthesizedNode(239 /* ThrowStatement */); node.expression = expression; return node; } @@ -71009,7 +70897,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241 /* TryStatement */); + var node = createSynthesizedNode(240 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -71025,12 +70913,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242 /* DebuggerStatement */); + return createSynthesizedNode(241 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71048,7 +70936,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -71068,7 +70956,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* VariableDeclarationList */); + var node = createSynthesizedNode(243 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -71081,7 +70969,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245 /* FunctionDeclaration */); + var node = createSynthesizedNode(244 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -71107,7 +70995,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* ClassDeclaration */); + var node = createSynthesizedNode(245 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71129,7 +71017,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247 /* InterfaceDeclaration */); + var node = createSynthesizedNode(246 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71151,7 +71039,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71171,7 +71059,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249 /* EnumDeclaration */); + var node = createSynthesizedNode(248 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71190,7 +71078,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(250 /* ModuleDeclaration */); + var node = createSynthesizedNode(249 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -71209,7 +71097,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251 /* ModuleBlock */); + var node = createSynthesizedNode(250 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -71221,7 +71109,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252 /* CaseBlock */); + var node = createSynthesizedNode(251 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -71233,7 +71121,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -71245,7 +71133,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71263,7 +71151,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ImportDeclaration */); + var node = createSynthesizedNode(254 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -71282,7 +71170,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256 /* ImportClause */); + var node = createSynthesizedNode(255 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -71298,13 +71186,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257 /* NamespaceImport */); + var node = createSynthesizedNode(256 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263 /* NamespaceExport */); + var node = createSynthesizedNode(262 /* NamespaceExport */); node.name = name; return node; } @@ -71322,7 +71210,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258 /* NamedImports */); + var node = createSynthesizedNode(257 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -71334,7 +71222,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259 /* ImportSpecifier */); + var node = createSynthesizedNode(258 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -71348,7 +71236,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260 /* ExportAssignment */); + var node = createSynthesizedNode(259 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -71366,7 +71254,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261 /* ExportDeclaration */); + var node = createSynthesizedNode(260 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -71391,7 +71279,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262 /* NamedExports */); + var node = createSynthesizedNode(261 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -71403,7 +71291,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264 /* ExportSpecifier */); + var node = createSynthesizedNode(263 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -71418,7 +71306,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266 /* ExternalModuleReference */); + var node = createSynthesizedNode(265 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -71432,14 +71320,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295 /* JSDocTypeExpression */); + var node = createSynthesizedNode(294 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71447,7 +71335,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71455,14 +71343,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -71472,12 +71360,12 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocClassTag() { - return createJSDocTag(311 /* JSDocClassTag */, "class"); + return createJSDocTag(310 /* JSDocClassTag */, "class"); } ts.createJSDocClassTag = createJSDocClassTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304 /* JSDocComment */); + var node = createSynthesizedNode(303 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -71491,7 +71379,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267 /* JsxElement */); + var node = createSynthesizedNode(266 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -71507,7 +71395,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71523,7 +71411,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269 /* JsxOpeningElement */); + var node = createSynthesizedNode(268 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71539,7 +71427,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270 /* JsxClosingElement */); + var node = createSynthesizedNode(269 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -71551,7 +71439,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271 /* JsxFragment */); + var node = createSynthesizedNode(270 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -71573,11 +71461,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272 /* JsxOpeningFragment */); + return createSynthesizedNode(271 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273 /* JsxClosingFragment */); + return createSynthesizedNode(272 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71589,7 +71477,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274 /* JsxAttribute */); + var node = createSynthesizedNode(273 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71603,7 +71491,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275 /* JsxAttributes */); + var node = createSynthesizedNode(274 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71615,7 +71503,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71627,7 +71515,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277 /* JsxExpression */); + var node = createSynthesizedNode(276 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71641,7 +71529,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278 /* CaseClause */); + var node = createSynthesizedNode(277 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71655,7 +71543,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279 /* DefaultClause */); + var node = createSynthesizedNode(278 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71667,7 +71555,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280 /* HeritageClause */); + var node = createSynthesizedNode(279 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71680,7 +71568,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281 /* CatchClause */); + var node = createSynthesizedNode(280 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71695,7 +71583,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282 /* PropertyAssignment */); + var node = createSynthesizedNode(281 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71710,7 +71598,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71724,7 +71612,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284 /* SpreadAssignment */); + var node = createSynthesizedNode(283 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71737,7 +71625,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285 /* EnumMember */); + var node = createSynthesizedNode(284 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71758,7 +71646,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291 /* SourceFile */); + var updated = createSynthesizedNode(290 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71842,7 +71730,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326 /* NotEmittedStatement */); + var node = createSynthesizedNode(325 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71854,7 +71742,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71866,7 +71754,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71881,7 +71769,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71897,7 +71785,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328 /* CommaListExpression */) { + if (node.kind === 327 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71907,7 +71795,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328 /* CommaListExpression */); + var node = createSynthesizedNode(327 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71920,7 +71808,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71936,7 +71824,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292 /* Bundle */); + var node = ts.createNode(291 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71971,7 +71859,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293 /* UnparsedSource */); + var node = ts.createNode(292 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -72106,10 +71994,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; - case "internal" /* Internal */: return 289 /* UnparsedInternalText */; - case "text" /* Text */: return 288 /* UnparsedText */; + case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; + case "internal" /* Internal */: return 288 /* UnparsedInternalText */; + case "text" /* Text */: return 287 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -72127,14 +72015,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294 /* InputFiles */); + var node = ts.createNode(293 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -72331,7 +72219,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72878,7 +72766,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72897,13 +72785,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72911,7 +72799,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7 /* All */); + var callee = skipOuterExpressions(expression, 15 /* All */); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -72930,7 +72818,7 @@ var ts; } else { switch (callee.kind) { - case 195 /* PropertyAccessExpression */: { + case 194 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72943,7 +72831,7 @@ var ts; } break; } - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -73003,14 +72891,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -73336,7 +73224,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 201 /* ParenthesizedExpression */) { + if (skipped.kind === 200 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -73370,10 +73258,10 @@ 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(210 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -73385,7 +73273,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 213 /* YieldExpression */) { + && operand.kind === 212 /* YieldExpression */) { return false; } return true; @@ -73473,7 +73361,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -73486,7 +73374,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -73521,8 +73409,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: needsParens = true; } } @@ -73538,9 +73426,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return ts.createParen(expression); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -73563,7 +73451,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73601,7 +73489,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73612,29 +73500,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { + if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); + return recreateOuterExpressions(expression, mutableCall, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { + if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73642,9 +73530,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173 /* TypeQuery */: - case 185 /* TypeOperator */: - case 182 /* InferType */: + case 172 /* TypeQuery */: + case 184 /* TypeOperator */: + case 181 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73670,28 +73558,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: node = node.operand; continue; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: node = node.left; continue; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: node = node.condition; continue; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: node = node.tag; continue; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 218 /* AsExpression */: - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: - case 219 /* NonNullExpression */: - case 327 /* PartiallyEmittedExpression */: + case 217 /* AsExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 218 /* NonNullExpression */: + case 326 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73700,71 +73588,61 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 328 /* CommaListExpression */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 327 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; (function (OuterExpressionKinds) { OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + OuterExpressionKinds[OuterExpressionKinds["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds[OuterExpressionKinds["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All"; })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 219 /* NonNullExpression */: - return (kinds & 2 /* Assertions */) !== 0; - case 327 /* PartiallyEmittedExpression */: - return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + return (kinds & 2 /* TypeAssertions */) !== 0; + case 218 /* NonNullExpression */: + return (kinds & 4 /* NonNullAssertions */) !== 0; + case 326 /* PartiallyEmittedExpression */: + return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = ts.skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { + if (kinds === void 0) { kinds = 15 /* All */; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6 /* Assertions */); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73782,7 +73660,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 201 /* ParenthesizedExpression */ + return node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73790,7 +73668,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -73900,10 +73778,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -74022,7 +73900,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -74034,11 +73912,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -74070,12 +73948,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 156 /* Parameter */: + case 191 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 214 /* SpreadElement */: - case 284 /* SpreadAssignment */: + case 213 /* SpreadElement */: + case 283 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -74093,7 +73971,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192 /* BindingElement */: + case 191 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -74108,7 +73986,7 @@ var ts; : propertyName; } break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -74123,7 +74001,7 @@ var ts; : propertyName; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -74146,13 +74024,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -74192,11 +74070,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -74355,289 +74233,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158 /* Decorator */: + case 157 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163 /* Constructor */: + case 162 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176 /* TupleType */: + case 175 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* RestType */: + case 177 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* UnionType */: + case 178 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182 /* InferType */: + case 181 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187 /* MappedType */: + case 186 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 224 /* Block */: + case 223 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForStatement */: + case 230 /* ForStatement */: 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, ts.liftToBlock)); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74680,58 +74558,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { + if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 223 /* SemicolonClassElement */: - case 225 /* EmptyStatement */: - case 216 /* OmittedExpression */: - case 242 /* DebuggerStatement */: - case 326 /* NotEmittedStatement */: + case 222 /* SemicolonClassElement */: + case 224 /* EmptyStatement */: + case 215 /* OmittedExpression */: + case 241 /* DebuggerStatement */: + case 325 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 157 /* Parameter */: + case 156 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158 /* Decorator */: + case 157 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74740,12 +74618,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* Constructor */: + case 162 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74753,7 +74631,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74761,50 +74639,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* NewExpression */: + case 197 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74812,123 +74690,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201 /* ParenthesizedExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218 /* AsExpression */: + case 217 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 224 /* Block */: + case 223 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 230 /* WhileStatement */: - case 237 /* WithStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74937,7 +74815,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74945,143 +74823,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -75154,7 +75032,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75828,7 +75706,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75879,7 +75757,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75892,13 +75770,13 @@ var ts; hasImportDefault = true; } break; - case 254 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + case 253 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75929,13 +75807,13 @@ var ts; } } break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75943,7 +75821,7 @@ var ts; } } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75963,7 +75841,7 @@ var ts; } } break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -76142,7 +76020,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 160 /* PropertyDeclaration */ + return member.kind === 159 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76771,8 +76649,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76798,14 +76676,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76856,16 +76734,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 251 /* ModuleBlock */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 250 /* ModuleBlock */: + case 223 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76877,7 +76755,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76920,10 +76798,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76944,13 +76822,13 @@ var ts; return node; } switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76970,11 +76848,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 261 /* ExportDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 256 /* ImportClause */ || - (node.kind === 254 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 266 /* ExternalModuleReference */)) { + if (node.kind === 260 /* ExportDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 255 /* ImportClause */ || + (node.kind === 253 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 265 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76998,19 +76876,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -77046,62 +76924,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: - case 139 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 174 /* TypeLiteral */: - case 169 /* TypePredicate */: - case 156 /* TypeParameter */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 173 /* TypeLiteral */: + case 168 /* TypePredicate */: + case 155 /* TypeParameter */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 129 /* BooleanKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 128 /* BooleanKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 137 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 145 /* SymbolKeyword */: - case 172 /* ConstructorType */: - case 171 /* FunctionType */: - case 173 /* TypeQuery */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 183 /* ParenthesizedType */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: + case 144 /* SymbolKeyword */: + case 171 /* ConstructorType */: + case 170 /* FunctionType */: + case 172 /* TypeQuery */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 182 /* ParenthesizedType */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 158 /* Decorator */: + case 157 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77111,7 +76989,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -77121,35 +76999,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -77159,35 +77037,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77600,12 +77478,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77758,7 +77636,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 160 /* PropertyDeclaration */ + ? member.kind === 159 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77881,10 +77759,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 160 /* PropertyDeclaration */; + return kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 159 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77894,7 +77772,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77905,12 +77783,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; } return false; @@ -77927,15 +77805,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: return serializeTypeNode(node.type); - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77972,7 +77850,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164 /* GetAccessor */) { + if (container && node.kind === 163 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -78018,30 +77896,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return ts.createVoidZero(); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createIdentifier("Function"); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return ts.createIdentifier("Array"); - case 169 /* TypePredicate */: - case 129 /* BooleanKeyword */: + case 168 /* TypePredicate */: + case 128 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return ts.createIdentifier("String"); - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -78052,34 +77930,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return serializeTypeReferenceNode(node); - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return serializeTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 185 /* TypeOperator */: - if (node.operator === 139 /* ReadonlyKeyword */) { + case 184 /* TypeOperator */: + if (node.operator === 138 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 173 /* TypeQuery */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 174 /* TypeLiteral */: + case 172 /* TypeQuery */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 173 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 184 /* ThisType */: - case 189 /* ImportType */: + case 148 /* UnknownKeyword */: + case 183 /* ThisType */: + case 188 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -78092,13 +77970,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -78207,7 +78085,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78527,7 +78405,7 @@ var ts; /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2 /* Assertions */); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */); if (ts.isAssertionExpression(innerExpression)) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; @@ -78767,12 +78645,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 249 /* EnumDeclaration */) { + if (node.kind === 248 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78897,7 +78775,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251 /* ModuleBlock */) { + if (body.kind === 250 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78943,13 +78821,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 251 /* ModuleBlock */) { + if (body.kind !== 250 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78999,7 +78877,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 257 /* NamespaceImport */) { + if (node.kind === 256 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -79247,16 +79125,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(250 /* ModuleDeclaration */); + context.enableEmitNotification(249 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; } /** * Hook for node emit. @@ -79317,9 +79195,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -79357,9 +79235,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 291 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); + if (container && container.kind !== 290 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -79510,40 +79388,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return visitClassLike(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194 /* ObjectLiteralExpression */: - case 193 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -79566,20 +79444,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -80345,31 +80223,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80378,27 +80256,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 224 /* Block */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 237 /* WithStatement */: - case 239 /* LabeledStatement */: + case 223 /* Block */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 236 /* WithStatement */: + case 238 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80603,7 +80481,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203 /* ArrowFunction */; + var isArrowFunction = node.kind === 202 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80694,17 +80572,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -80752,11 +80630,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80788,11 +80666,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80960,64 +80838,64 @@ var ts; return node; } switch (node.kind) { - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitVoidExpression(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -81051,7 +80929,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -81063,7 +80941,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284 /* SpreadAssignment */) { + if (e.kind === 283 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -81072,7 +80950,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -81106,7 +80984,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -81484,17 +81362,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -81542,11 +81420,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -81578,11 +81456,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81680,7 +81558,7 @@ var ts; return node; } switch (node.kind) { - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81712,30 +81590,32 @@ var ts; return node; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -81766,7 +81646,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 /* PropertyAccessExpression */ + expression = node.kind === 194 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81780,10 +81660,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81802,8 +81682,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81813,11 +81693,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 /* PropertyAccessExpression */ + rightExpression = segment.kind === 194 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81915,13 +81795,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81931,13 +81811,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -82012,7 +81892,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277 /* JsxExpression */) { + else if (node.kind === 276 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -82106,7 +81986,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267 /* JsxElement */) { + if (node.kind === 266 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -82412,7 +82292,7 @@ var ts; return node; } switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82625,13 +82505,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 236 /* ReturnStatement */ + && node.kind === 235 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82653,63 +82533,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return visitClassExpression(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82720,28 +82600,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitMetaProperty(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82832,14 +82712,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82850,7 +82730,7 @@ var ts; } } else { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -83246,11 +83126,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 236 /* ReturnStatement */) { + if (statement.kind === 235 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 228 /* IfStatement */) { + else if (statement.kind === 227 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -83258,7 +83138,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 224 /* Block */) { + else if (statement.kind === 223 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -83456,7 +83336,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -83477,22 +83357,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return statements; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -83524,20 +83404,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83739,7 +83619,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83783,7 +83663,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203 /* ArrowFunction */); + ts.Debug.assert(node.kind === 202 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83851,9 +83731,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83872,9 +83752,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -84088,14 +83968,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -84283,7 +84163,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155 /* ComputedPropertyName */) { + if (property.name.kind === 154 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -84404,11 +84284,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -84433,11 +84313,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84836,20 +84716,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84956,7 +84836,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -85448,13 +85328,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(163 /* Constructor */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(203 /* ArrowFunction */); - context.enableEmitNotification(202 /* FunctionExpression */); - context.enableEmitNotification(245 /* FunctionDeclaration */); + context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(202 /* ArrowFunction */); + context.enableEmitNotification(201 /* FunctionExpression */); + context.enableEmitNotification(244 /* FunctionDeclaration */); } } /** @@ -85495,10 +85375,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 242 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -85580,11 +85460,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85592,7 +85472,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85632,15 +85512,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269 /* JsxOpeningElement */); - context.enableEmitNotification(270 /* JsxClosingElement */); - context.enableEmitNotification(268 /* JsxSelfClosingElement */); + context.enableEmitNotification(268 /* JsxOpeningElement */); + context.enableEmitNotification(269 /* JsxClosingElement */); + context.enableEmitNotification(267 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(282 /* PropertyAssignment */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(281 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85659,9 +85539,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85996,13 +85876,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -86015,24 +85895,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return visitBreakStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return visitContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -86053,21 +85933,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitConditionalExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -86080,9 +85960,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -86290,7 +86170,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -86302,7 +86182,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86678,35 +86558,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: return transformAndEmitBlock(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return transformAndEmitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return transformAndEmitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return transformAndEmitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return transformAndEmitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -87136,7 +87016,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -87149,7 +87029,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -88378,11 +88258,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88706,23 +88586,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88749,24 +88629,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -89266,7 +89146,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -89321,10 +89201,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -89537,7 +89417,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89601,10 +89481,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89625,7 +89505,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89700,7 +89580,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89799,12 +89679,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -90028,7 +89908,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -90053,7 +89933,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261 /* ExportDeclaration */) { + if (externalImport.kind !== 260 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -90136,19 +90016,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -90207,13 +90087,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -90393,7 +90273,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -90457,7 +90337,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -90519,10 +90399,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90702,43 +90582,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitDefaultClause(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitTryStatement(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90985,7 +90865,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291 /* SourceFile */; + return container !== undefined && container.kind === 290 /* SourceFile */; } else { return false; @@ -91018,7 +90898,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -91068,7 +90948,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -91104,12 +90984,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -91202,14 +91082,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209 /* PostfixUnaryExpression */) { + if (node.kind === 208 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -91237,7 +91117,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -91276,7 +91156,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291 /* SourceFile */); + context.enableEmitNotification(290 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -91301,12 +91181,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -91437,7 +91317,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91466,7 +91346,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91513,7 +91393,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91522,8 +91402,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || - (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || + (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -91532,7 +91412,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 === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { + else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91557,7 +91437,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91596,26 +91476,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have return types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have return types that cannot be named 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 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91623,7 +91503,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91637,7 +91517,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91662,30 +91542,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 167 /* ConstructSignature */: - case 172 /* ConstructorType */: + case 166 /* ConstructSignature */: + case 171 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91693,7 +91573,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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91706,15 +91586,15 @@ 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 245 /* FunctionDeclaration */: - case 171 /* FunctionType */: + case 244 /* FunctionDeclaration */: + case 170 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91728,39 +91608,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187 /* MappedType */: + case 186 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { 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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { 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 171 /* FunctionType */: - case 245 /* FunctionDeclaration */: + case 170 /* FunctionType */: + case 244 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91775,7 +91655,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 246 /* ClassDeclaration */) { + if (node.parent.parent.kind === 245 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91826,7 +91706,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91985,10 +91865,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -92011,14 +91891,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -92159,7 +92039,7 @@ var ts; return name; } else { - if (name.kind === 191 /* ArrayBindingPattern */) { + if (name.kind === 190 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -92167,7 +92047,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216 /* OmittedExpression */) { + if (elem.kind === 215 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -92205,7 +92085,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 157 /* Parameter */ && + var shouldUseResolverType = node.kind === 156 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -92214,7 +92094,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -92225,12 +92105,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 /* Parameter */ - || node.kind === 160 /* PropertyDeclaration */ - || node.kind === 159 /* PropertySignature */) { + if (node.kind === 156 /* Parameter */ + || node.kind === 159 /* PropertyDeclaration */ + || node.kind === 158 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -92247,20 +92127,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return false; } return false; @@ -92341,7 +92221,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -92361,7 +92241,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -92388,7 +92268,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -92477,7 +92357,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -92498,38 +92378,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217 /* ExpressionWithTypeArguments */: { + case 216 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170 /* TypeReference */: { + case 169 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163 /* Constructor */: { + case 162 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162 /* MethodDeclaration */: { + case 161 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164 /* GetAccessor */: { + case 163 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92538,7 +92418,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 165 /* SetAccessor */: { + case 164 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92546,31 +92426,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161 /* MethodSignature */: { + case 160 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166 /* CallSignature */: { + case 165 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168 /* IndexSignature */: { + case 167 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -92578,13 +92458,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156 /* TypeParameter */: { + case 155 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181 /* ConditionalType */: { + case 180 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92596,13 +92476,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171 /* FunctionType */: { + case 170 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172 /* ConstructorType */: { + case 171 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189 /* ImportType */: { + case 188 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92631,7 +92511,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92641,7 +92521,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261 /* ExportDeclaration */: { + case 260 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92651,7 +92531,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92667,7 +92547,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92692,10 +92572,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92716,14 +92596,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247 /* InterfaceDeclaration */: { + case 246 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245 /* FunctionDeclaration */: { + case 244 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92771,10 +92651,10 @@ var ts; return clean; } } - case 250 /* ModuleDeclaration */: { + case 249 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251 /* ModuleBlock */) { + if (inner && inner.kind === 250 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92817,7 +92697,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 246 /* ClassDeclaration */: { + case 245 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92878,7 +92758,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92898,10 +92778,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 249 /* EnumDeclaration */: { + case 248 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92920,7 +92800,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250 /* ModuleDeclaration */) { + if (input.kind === 249 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92941,7 +92821,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216 /* OmittedExpression */) { + if (e.kind === 215 /* OmittedExpression */) { return; } if (e.name) { @@ -92991,7 +92871,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 291 /* SourceFile */; + var parentIsFile = node.parent.kind === 290 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -93020,7 +92900,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { return true; } return false; @@ -93045,7 +92925,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 /* GetAccessor */ + return accessor.kind === 163 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -93054,52 +92934,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 226 /* VariableStatement */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 225 /* VariableStatement */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 243 /* VariableDeclaration */: - case 156 /* TypeParameter */: - case 217 /* ExpressionWithTypeArguments */: - case 170 /* TypeReference */: - case 181 /* ConditionalType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 189 /* ImportType */: + case 166 /* ConstructSignature */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 242 /* VariableDeclaration */: + case 155 /* TypeParameter */: + case 216 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 180 /* ConditionalType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 188 /* ImportType */: return true; } return false; @@ -93232,7 +93112,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332 /* Count */); + var enabledSyntaxKindFeatures = new Array(331 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93596,7 +93476,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292 /* Bundle */) { + if (sourceFile.kind === 291 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93926,7 +93806,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93949,8 +93829,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93991,7 +93871,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -94102,7 +93982,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -94114,7 +93994,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -94292,9 +94172,9 @@ var ts; break; } switch (node.kind) { - case 291 /* SourceFile */: return printFile(node); - case 292 /* Bundle */: return printBundle(node); - case 293 /* UnparsedSource */: return printUnparsedSource(node); + case 290 /* SourceFile */: return printFile(node); + case 291 /* Bundle */: return printBundle(node); + case 292 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -94550,12 +94430,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94597,15 +94477,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 293 /* UnparsedSource */: - case 287 /* UnparsedPrepend */: + case 292 /* UnparsedSource */: + case 286 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 286 /* UnparsedPrologue */: + case 285 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 290 /* UnparsedSyntheticReference */: + case 289 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94615,260 +94495,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return emitQualifiedName(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return emitTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return emitParameter(node); - case 158 /* Decorator */: + case 157 /* Decorator */: return emitDecorator(node); // Type members - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return emitPropertySignature(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return emitMethodSignature(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return emitConstructor(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return emitAccessorDeclaration(node); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return emitCallSignature(node); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return emitConstructSignature(node); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return emitIndexSignature(node); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return emitTypePredicate(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return emitTypeReference(node); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return emitFunctionType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return emitConstructorType(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return emitTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return emitTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return emitArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return emitTupleType(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return emitOptionalType(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return emitUnionType(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return emitIntersectionType(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return emitConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return emitInferType(node); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return emitParenthesizedType(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return emitThisType(); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return emitTypeOperator(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return emitMappedType(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return emitLiteralType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return emitImportTypeNode(node); - case 296 /* JSDocAllType */: + case 295 /* JSDocAllType */: writePunctuation("*"); return; - case 297 /* JSDocUnknownType */: + case 296 /* JSDocUnknownType */: writePunctuation("?"); return; - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 178 /* RestType */: - case 302 /* JSDocVariadicType */: + case 177 /* RestType */: + case 301 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return emitBindingElement(node); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return emitTemplateSpan(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 224 /* Block */: + case 223 /* Block */: return emitBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return emitVariableStatement(node); - case 225 /* EmptyStatement */: + case 224 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return emitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return emitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return emitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return emitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return emitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return emitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return emitForOfStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return emitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return emitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return emitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return emitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return emitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return emitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return emitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return emitTryStatement(node); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return emitClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return emitModuleBlock(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return emitCaseBlock(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return emitImportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return emitImportClause(node); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return emitNamespaceImport(node); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return emitNamespaceExport(node); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return emitNamedImports(node); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return emitImportSpecifier(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return emitExportDeclaration(node); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return emitNamedExports(node); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return emitExportSpecifier(node); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 270 /* JsxClosingElement */: - case 273 /* JsxClosingFragment */: + case 269 /* JsxClosingElement */: + case 272 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return emitJsxAttribute(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return emitJsxAttributes(node); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return emitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return emitDefaultClause(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return emitHeritageClause(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 309 /* JSDocImplementsTag */: - case 308 /* JSDocAugmentsTag */: + case 308 /* JSDocImplementsTag */: + case 307 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return emitJSDocSignature(node); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 311 /* JSDocClassTag */: - case 307 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 306 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94905,71 +94785,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return emitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return emitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return emitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return emitArrowFunction(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return emitDeleteExpression(node); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return emitVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return emitAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return emitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return emitConditionalExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return emitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return emitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return emitSpreadExpression(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return emitClassExpression(node); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return; - case 218 /* AsExpression */: + case 217 /* AsExpression */: return emitAsExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return emitNonNullExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return emitJsxElement(node); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return emitCommaList(node); } } @@ -95011,7 +94891,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 /* Bundle */ ? node : undefined; + var bundle = node.kind === 291 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -95111,7 +94991,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -95184,7 +95064,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -95246,7 +95126,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -95429,7 +95309,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -95663,7 +95543,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 208 /* PrefixUnaryExpression */ + return operand.kind === 207 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95851,7 +95731,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228 /* IfStatement */) { + if (node.elseStatement.kind === 227 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95914,7 +95794,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95922,7 +95802,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { emit(node); } else { @@ -96218,7 +96098,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250 /* ModuleDeclaration */) { + while (body.kind === 249 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -96263,7 +96143,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -96271,7 +96151,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -96311,7 +96191,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -96323,7 +96203,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -96334,7 +96214,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -96554,7 +96434,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -96588,7 +96468,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96607,7 +96487,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -97427,7 +97307,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -97492,84 +97372,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: ts.forEach(node.statements, generateNames); break; - case 239 /* LabeledStatement */: - case 237 /* WithStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 238 /* LabeledStatement */: + case 236 /* WithStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: generateNames(node.statement); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: generateNames(node.declarationList); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: generateNames(node.importClause); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -97578,12 +97458,12 @@ var ts; if (!node) return; switch (node.kind) { - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97765,23 +97645,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 259 /* ExportAssignment */: return generateNameForExportDefault(); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return generateNameForClassExpression(); - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97829,7 +97709,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97853,7 +97733,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -98112,7 +97992,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -98125,7 +98005,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -100151,22 +100031,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 243 /* VariableDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 242 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -100174,58 +100054,58 @@ var ts; } } switch (node.kind) { - case 256 /* ImportClause */: + case 255 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); + case 249 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218 /* AsExpression */: + case 217 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -100234,29 +100114,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); return "skip"; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -100268,19 +100148,19 @@ var ts; return "skip"; } break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: - case 199 /* TaggedTemplateExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 198 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -100302,8 +100182,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: - case 131 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break; @@ -107344,37 +107224,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 281 /* CatchClause */: - case 274 /* JsxAttribute */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 280 /* CatchClause */: + case 273 /* JsxAttribute */: return 1 /* Value */; - case 156 /* TypeParameter */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 174 /* TypeLiteral */: + case 155 /* TypeParameter */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 173 /* TypeLiteral */: return 2 /* Type */; - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 285 /* EnumMember */: - case 246 /* ClassDeclaration */: + case 284 /* EnumMember */: + case 245 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -107384,16 +107264,16 @@ var ts; else { return 4 /* Namespace */; } - case 249 /* EnumDeclaration */: - case 258 /* NamedImports */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 248 /* EnumDeclaration */: + case 257 /* NamedImports */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -107401,10 +107281,10 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 260 /* ExportAssignment */ || node.parent.kind === 266 /* ExternalModuleReference */) { + else if (node.parent.kind === 259 /* ExportAssignment */ || node.parent.kind === 265 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -107436,11 +107316,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 154 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 254 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 153 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 253 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -107452,27 +107332,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 154 /* QualifiedName */) { - while (root.parent && root.parent.kind === 154 /* QualifiedName */) { + if (root.parent.kind === 153 /* QualifiedName */) { + while (root.parent && root.parent.kind === 153 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 170 /* TypeReference */ && !isLastClause; + return root.parent.kind === 169 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 195 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 195 /* PropertyAccessExpression */) { + if (root.parent.kind === 194 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 194 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 217 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 280 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 216 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 279 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 246 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || - (decl.kind === 247 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); + return (decl.kind === 245 /* ClassDeclaration */ && root.parent.parent.token === 113 /* ImplementsKeyword */) || + (decl.kind === 246 /* InterfaceDeclaration */ && root.parent.parent.token === 90 /* ExtendsKeyword */); } return false; } @@ -107483,15 +107363,15 @@ var ts; switch (node.kind) { case 104 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return true; } switch (node.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return true; - case 189 /* ImportType */: + case 188 /* ImportType */: return !node.parent.isTypeOf; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -107558,7 +107438,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 239 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 238 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -107619,22 +107499,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 250 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 249 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return true; - case 188 /* LiteralType */: - return node.parent.parent.kind === 186 /* IndexedAccessType */; + case 187 /* LiteralType */: + return node.parent.parent.kind === 185 /* IndexedAccessType */; default: return false; } @@ -107658,17 +107538,17 @@ var ts; return undefined; } switch (node.kind) { - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return node; } } @@ -107676,54 +107556,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return "class" /* classElement */; - case 247 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 248 /* TypeAliasDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 246 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 247 /* TypeAliasDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 249 /* EnumDeclaration */: return "enum" /* enumElement */; - case 243 /* VariableDeclaration */: + case 248 /* EnumDeclaration */: return "enum" /* enumElement */; + case 242 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return "function" /* functionElement */; - case 164 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 165 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 163 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 164 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 168 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 167 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 166 /* CallSignature */: return "call" /* callSignatureElement */; - case 163 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 156 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 285 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 157 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: + case 167 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 166 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 165 /* CallSignature */: return "call" /* callSignatureElement */; + case 162 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 155 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 284 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 156 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: return "alias" /* alias */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -107752,7 +107632,7 @@ var ts; } case 75 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -107775,7 +107655,7 @@ var ts; return true; case 75 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 157 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 156 /* Parameter */; default: return false; } @@ -107840,42 +107720,42 @@ var ts; return false; } switch (n.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 190 /* ObjectBindingPattern */: - case 174 /* TypeLiteral */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 252 /* CaseBlock */: - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 173 /* TypeLiteral */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 251 /* CaseBlock */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 198 /* NewExpression */: + case 197 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 197 /* CallExpression */: - case 201 /* ParenthesizedExpression */: - case 183 /* ParenthesizedType */: + case 196 /* CallExpression */: + case 200 /* ParenthesizedExpression */: + case 182 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 202 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -107885,65 +107765,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 193 /* ArrayLiteralExpression */: - case 191 /* ArrayBindingPattern */: - case 196 /* ElementAccessExpression */: - case 155 /* ComputedPropertyName */: - case 176 /* TupleType */: + case 192 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 195 /* ElementAccessExpression */: + case 154 /* ComputedPropertyName */: + case 175 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 111 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 205 /* TypeOfExpression */: - case 204 /* DeleteExpression */: - case 206 /* VoidExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: + case 204 /* TypeOfExpression */: + case 203 /* DeleteExpression */: + case 205 /* VoidExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -108050,11 +107930,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -108149,11 +108029,11 @@ var ts; node.kind === 94 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 114 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 88 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 146 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 137 /* NamespaceKeyword */ || node.kind === 136 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 145 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 136 /* NamespaceKeyword */ || node.kind === 135 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 96 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : - node.kind === 132 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 143 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 131 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : + node.kind === 142 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -108167,7 +108047,7 @@ var ts; return decl.name; } } - if (node.kind === 146 /* TypeKeyword */) { + if (node.kind === 145 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -108234,12 +108114,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 140 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 139 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 150 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 149 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -108264,7 +108144,7 @@ var ts; } } // ... T extends /**/infer [|U|] ? ... - if (node.kind === 133 /* InferKeyword */ && ts.isInferTypeNode(parent)) { + if (node.kind === 132 /* InferKeyword */ && ts.isInferTypeNode(parent)) { return parent.typeParameter.name; } // { [ [|K|] /**/in keyof T]: ... } @@ -108272,12 +108152,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 135 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 135 /* KeyOfKeyword */ && + if (node.kind === 134 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 134 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 139 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 139 /* ReadonlyKeyword */ && + if (node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -108314,7 +108194,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 97 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 153 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 152 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -108455,7 +108335,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 291 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 290 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -108525,17 +108405,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 277 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 276 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 270 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 269 /* JsxClosingElement */) { return true; } return false; @@ -108600,7 +108480,7 @@ var ts; function getPossibleGenericSignatures(called, typeArgumentCount, checker) { var type = checker.getTypeAtLocation(called); if (ts.isOptionalChain(called.parent)) { - type = removeOptionality(type, !!called.parent.questionDotToken, /*isOptionalChain*/ true); + type = removeOptionality(type, ts.isOptionalChainRoot(called.parent), /*isOptionalChain*/ true); } var signatures = ts.isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); return signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; }); @@ -108676,7 +108556,7 @@ var ts; // falls through case 108 /* TypeOfKeyword */: case 90 /* ExtendsKeyword */: - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -108731,16 +108611,16 @@ var ts; result.push("export" /* exportedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 260 /* ExportAssignment */) + if (node.kind === 259 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 170 /* TypeReference */ || node.kind === 197 /* CallExpression */) { + if (node.kind === 169 /* TypeReference */ || node.kind === 196 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 246 /* ClassDeclaration */ || node.kind === 247 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 245 /* ClassDeclaration */ || node.kind === 246 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -108785,18 +108665,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 193 /* ArrayLiteralExpression */ || - node.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 192 /* ArrayLiteralExpression */ || + node.kind === 193 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 210 /* BinaryExpression */ && + if (node.parent.kind === 209 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 233 /* ForOfStatement */ && + if (node.parent.kind === 232 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -108804,7 +108684,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 282 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 281 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -108850,29 +108730,29 @@ var ts; ts.typeKeywords = [ 125 /* AnyKeyword */, 124 /* AssertsKeyword */, - 152 /* BigIntKeyword */, - 129 /* BooleanKeyword */, + 151 /* BigIntKeyword */, + 128 /* BooleanKeyword */, 91 /* FalseKeyword */, - 135 /* KeyOfKeyword */, - 138 /* NeverKeyword */, + 134 /* KeyOfKeyword */, + 137 /* NeverKeyword */, 100 /* NullKeyword */, - 141 /* NumberKeyword */, - 142 /* ObjectKeyword */, - 139 /* ReadonlyKeyword */, - 144 /* StringKeyword */, - 145 /* SymbolKeyword */, + 140 /* NumberKeyword */, + 141 /* ObjectKeyword */, + 138 /* ReadonlyKeyword */, + 143 /* StringKeyword */, + 144 /* SymbolKeyword */, 106 /* TrueKeyword */, 110 /* VoidKeyword */, - 147 /* UndefinedKeyword */, - 148 /* UniqueKeyword */, - 149 /* UnknownKeyword */, + 146 /* UndefinedKeyword */, + 147 /* UniqueKeyword */, + 148 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 146 /* TypeKeyword */; + return node.kind === 145 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -108905,7 +108785,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 155 /* ComputedPropertyName */ + return name.kind === 154 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -109065,7 +108945,7 @@ var ts; } ts.findModifier = findModifier; function insertImport(changes, sourceFile, importDecl, blankLineBetween) { - var importKindPredicate = importDecl.kind === 226 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; + var importKindPredicate = importDecl.kind === 225 /* VariableStatement */ ? ts.isRequireVariableDeclarationStatement : ts.isAnyImportSyntax; var lastImportDeclaration = ts.findLast(sourceFile.statements, function (statement) { return importKindPredicate(statement); }); if (lastImportDeclaration) { changes.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); @@ -109111,7 +108991,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 157 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 156 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -109575,15 +109455,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checker.getContextualType(parent); - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 278 /* CaseClause */: + case 277 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -109622,8 +109502,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 199 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: return true; default: return false; @@ -109656,41 +109536,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 166 /* CallSignature */ - || kind === 167 /* ConstructSignature */ - || kind === 168 /* IndexSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */; + return kind === 165 /* CallSignature */ + || kind === 166 /* ConstructSignature */ + || kind === 167 /* IndexSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 244 /* FunctionDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 250 /* ModuleDeclaration */; + return kind === 249 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 226 /* VariableStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 229 /* DoStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 235 /* BreakStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 160 /* PropertyDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 260 /* ExportAssignment */; + return kind === 225 /* VariableStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 228 /* DoStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 234 /* BreakStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 159 /* PropertyDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 259 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -109720,7 +109600,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 229 /* DoStatement */) { + if (node.kind === 228 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -110087,10 +109967,10 @@ var ts; } break; case 125 /* AnyKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -110279,9 +110159,9 @@ var ts; return true; } switch (keyword2) { - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - case 130 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + case 129 /* ConstructorKeyword */: case 120 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: @@ -110422,10 +110302,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -110645,18 +110525,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -110807,22 +110687,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -110851,17 +110731,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 243 /* VariableDeclaration */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 157 /* Parameter */ || - parent.kind === 274 /* JsxAttribute */) { + if (parent.kind === 242 /* VariableDeclaration */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 156 /* Parameter */ || + parent.kind === 273 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 210 /* BinaryExpression */ || - parent.kind === 208 /* PrefixUnaryExpression */ || - parent.kind === 209 /* PostfixUnaryExpression */ || - parent.kind === 211 /* ConditionalExpression */) { + if (parent.kind === 209 /* BinaryExpression */ || + parent.kind === 207 /* PrefixUnaryExpression */ || + parent.kind === 208 /* PostfixUnaryExpression */ || + parent.kind === 210 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -110874,7 +110754,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 274 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 273 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -110890,32 +110770,32 @@ var ts; else if (tokenKind === 75 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 157 /* Parameter */: + case 156 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -111039,11 +110919,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (parent.parent.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -111051,9 +110931,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 189 /* ImportType */: + case 188 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 179 /* UnionType */: { + case 178 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -111063,7 +110943,7 @@ var ts; default: return undefined; } - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -111080,7 +110960,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -111093,8 +110973,8 @@ var ts; } return undefined; } - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -111103,9 +110983,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 266 /* ExternalModuleReference */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 265 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -112056,11 +111936,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -112070,7 +111950,7 @@ var ts; case 78 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 267 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 266 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -112089,7 +111969,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 291 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 290 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -112140,11 +112020,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 324 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 323 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -112196,7 +112076,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -112208,14 +112088,14 @@ var ts; return undefined; } break; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: node = parent.left; break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: node = parent.name; break; - case 189 /* ImportType */: - case 220 /* MetaProperty */: + case 188 /* ImportType */: + case 219 /* MetaProperty */: node = parent; break; default: @@ -112228,7 +112108,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 195 /* PropertyAccessExpression */) { + if (parent && parent.kind === 194 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -112236,38 +112116,38 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 267 /* JsxElement */ || currentToken.parent.kind === 269 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 266 /* JsxElement */ || currentToken.parent.kind === 268 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 268 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 267 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: + case 268 /* JsxOpeningElement */: if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -112347,11 +112227,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 323 /* JSDocTypedefTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 322 /* JSDocTypedefTag */: return true; default: return false; @@ -112396,7 +112276,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 291 /* SourceFile */ && d.kind !== 250 /* ModuleDeclaration */ && d.kind !== 249 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 290 /* SourceFile */ && d.kind !== 249 /* ModuleDeclaration */ && d.kind !== 248 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -112443,7 +112323,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 189 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 188 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -112599,7 +112479,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 291 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 290 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -112649,10 +112529,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 291 /* SourceFile */: - case 212 /* TemplateExpression */: - case 277 /* JsxExpression */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 211 /* TemplateExpression */: + case 276 /* JsxExpression */: + case 223 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -112698,27 +112578,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 108 /* TypeOfKeyword */ && - (contextToken.parent.kind === 173 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 172 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 160 /* PropertyDeclaration */ || - parentKind === 159 /* PropertySignature */ || - parentKind === 157 /* Parameter */ || - parentKind === 243 /* VariableDeclaration */ || + return parentKind === 159 /* PropertyDeclaration */ || + parentKind === 158 /* PropertySignature */ || + parentKind === 156 /* Parameter */ || + parentKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 248 /* TypeAliasDeclaration */; + return parentKind === 247 /* TypeAliasDeclaration */; case 123 /* AsKeyword */: - return parentKind === 218 /* AsExpression */; + return parentKind === 217 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 170 /* TypeReference */ || - parentKind === 200 /* TypeAssertionExpression */; + return parentKind === 169 /* TypeReference */ || + parentKind === 199 /* TypeAssertionExpression */; case 90 /* ExtendsKeyword */: - return parentKind === 156 /* TypeParameter */; + return parentKind === 155 /* TypeParameter */; } } return false; @@ -112929,7 +112809,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 269 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 268 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -112939,10 +112819,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 269 /* JsxOpeningElement */; + return location.parent.kind !== 268 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 270 /* JsxClosingElement */ || contextToken.parent.kind === 268 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 267 /* JsxElement */; + if (contextToken.parent.kind === 269 /* JsxClosingElement */ || contextToken.parent.kind === 267 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 266 /* JsxElement */; } } return false; @@ -112953,40 +112833,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 197 /* CallExpression */ // func( a, | - || containingNodeKind === 163 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 198 /* NewExpression */ // new C(a, | - || containingNodeKind === 193 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 210 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 171 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 196 /* CallExpression */ // func( a, | + || containingNodeKind === 162 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 197 /* NewExpression */ // new C(a, | + || containingNodeKind === 192 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 209 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 170 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 197 /* CallExpression */ // func( | - || containingNodeKind === 163 /* Constructor */ // constructor( | - || containingNodeKind === 198 /* NewExpression */ // new C(a| - || containingNodeKind === 201 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 183 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 196 /* CallExpression */ // func( | + || containingNodeKind === 162 /* Constructor */ // constructor( | + || containingNodeKind === 197 /* NewExpression */ // new C(a| + || containingNodeKind === 200 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 182 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 193 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 168 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 155 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 136 /* ModuleKeyword */: // module | - case 137 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 192 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 167 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 154 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 135 /* ModuleKeyword */: // module | + case 136 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 250 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 249 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 246 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 245 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 243 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 210 /* BinaryExpression */; // x = a| + return containingNodeKind === 242 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 209 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 212 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 211 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 222 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 221 /* TemplateSpan */; // `aa ${10} dd ${| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 159 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -113013,7 +112893,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 194 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 193 /* ObjectLiteralExpression */) { var instantiatedType = typeChecker.getContextualType(objectLikeContainer); var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); if (!instantiatedType || !completionsType) @@ -113023,7 +112903,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 190 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 189 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -113034,12 +112914,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 233 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 157 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 232 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 156 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 162 /* MethodDeclaration */ || rootDeclaration.parent.kind === 165 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 161 /* MethodDeclaration */ || rootDeclaration.parent.kind === 164 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -113089,7 +112969,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 258 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 257 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -113211,11 +113091,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: - case 275 /* JsxAttributes */: - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 268 /* JsxSelfClosingElement */ || parent.kind === 269 /* JsxOpeningElement */)) { + case 194 /* PropertyAccessExpression */: + case 274 /* JsxAttributes */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 267 /* JsxSelfClosingElement */ || parent.kind === 268 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -113223,7 +113103,7 @@ var ts; } return parent; } - else if (parent.kind === 274 /* JsxAttribute */) { + else if (parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113235,7 +113115,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 274 /* JsxAttribute */) || (parent.kind === 276 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 273 /* JsxAttribute */) || (parent.kind === 275 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113245,8 +113125,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 277 /* JsxExpression */ && - parent.parent && parent.parent.kind === 274 /* JsxAttribute */) { + parent.kind === 276 /* JsxExpression */ && + parent.parent && parent.parent.kind === 273 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113254,7 +113134,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 276 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 275 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -113274,51 +113154,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 243 /* VariableDeclaration */ || + return containingNodeKind === 242 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 226 /* VariableStatement */ || - containingNodeKind === 249 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 225 /* VariableStatement */ || + containingNodeKind === 248 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 192 /* BindingElement */; // var {x :html| + return containingNodeKind === 191 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 191 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 190 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 281 /* CatchClause */ || + return containingNodeKind === 280 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 249 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 248 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 246 /* ClassDeclaration */ || // class A< | - containingNodeKind === 215 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 247 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 248 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 245 /* ClassDeclaration */ || // class A< | + containingNodeKind === 214 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 246 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 247 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 120 /* StaticKeyword */: - return containingNodeKind === 160 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 159 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 157 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 191 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 156 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 190 /* ArrayBindingPattern */); // var [...z| case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - return containingNodeKind === 157 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 156 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 123 /* AsKeyword */: - return containingNodeKind === 259 /* ImportSpecifier */ || - containingNodeKind === 264 /* ExportSpecifier */ || - containingNodeKind === 257 /* NamespaceImport */; - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + return containingNodeKind === 258 /* ImportSpecifier */ || + containingNodeKind === 263 /* ExportSpecifier */ || + containingNodeKind === 256 /* NamespaceImport */; + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 80 /* ClassKeyword */: case 88 /* EnumKeyword */: @@ -113329,7 +113209,7 @@ var ts; case 115 /* LetKeyword */: case 81 /* ConstKeyword */: case 121 /* YieldKeyword */: - case 146 /* TypeKeyword */: // type htm| + case 145 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -113355,7 +113235,7 @@ var ts; case 122 /* AbstractKeyword */: case 80 /* ClassKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: case 94 /* FunctionKeyword */: case 114 /* InterfaceKeyword */: @@ -113377,7 +113257,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 163 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 162 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -113387,7 +113267,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ + return node.parent.kind === 243 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -113405,13 +113285,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 282 /* PropertyAssignment */ && - m.kind !== 283 /* ShorthandPropertyAssignment */ && - m.kind !== 192 /* BindingElement */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */ && - m.kind !== 284 /* SpreadAssignment */) { + if (m.kind !== 281 /* PropertyAssignment */ && + m.kind !== 282 /* ShorthandPropertyAssignment */ && + m.kind !== 191 /* BindingElement */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */ && + m.kind !== 283 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113482,10 +113362,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 160 /* PropertyDeclaration */ && - m.kind !== 162 /* MethodDeclaration */ && - m.kind !== 164 /* GetAccessor */ && - m.kind !== 165 /* SetAccessor */) { + if (m.kind !== 159 /* PropertyDeclaration */ && + m.kind !== 161 /* MethodDeclaration */ && + m.kind !== 163 /* GetAccessor */ && + m.kind !== 164 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -113526,7 +113406,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 274 /* JsxAttribute */) { + if (attr.kind === 273 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -113576,7 +113456,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 77 /* FirstKeyword */; i <= 153 /* LastKeyword */; i++) { + for (var i = 77 /* FirstKeyword */; i <= 152 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -113602,12 +113482,12 @@ var ts; return false; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) - || kind === 131 /* DeclareKeyword */ - || kind === 136 /* ModuleKeyword */ - || kind === 146 /* TypeKeyword */ - || kind === 137 /* NamespaceKeyword */ + || kind === 130 /* DeclareKeyword */ + || kind === 135 /* ModuleKeyword */ + || kind === 145 /* TypeKeyword */ + || kind === 136 /* NamespaceKeyword */ || kind === 123 /* AsKeyword */ - || ts.isTypeKeyword(kind) && kind !== 147 /* UndefinedKeyword */; + || ts.isTypeKeyword(kind) && kind !== 146 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -113629,46 +113509,46 @@ var ts; switch (kind) { case 122 /* AbstractKeyword */: case 125 /* AnyKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 131 /* DeclareKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 130 /* DeclareKeyword */: case 88 /* EnumKeyword */: - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: case 113 /* ImplementsKeyword */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 114 /* InterfaceKeyword */: - case 134 /* IsKeyword */: - case 135 /* KeyOfKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 138 /* NeverKeyword */: - case 141 /* NumberKeyword */: - case 142 /* ObjectKeyword */: + case 133 /* IsKeyword */: + case 134 /* KeyOfKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 137 /* NeverKeyword */: + case 140 /* NumberKeyword */: + case 141 /* ObjectKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: - case 144 /* StringKeyword */: - case 145 /* SymbolKeyword */: - case 146 /* TypeKeyword */: - case 148 /* UniqueKeyword */: - case 149 /* UnknownKeyword */: + case 138 /* ReadonlyKeyword */: + case 143 /* StringKeyword */: + case 144 /* SymbolKeyword */: + case 145 /* TypeKeyword */: + case 147 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 139 /* ReadonlyKeyword */; + return kind === 138 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 122 /* AbstractKeyword */: - case 130 /* ConstructorKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 129 /* ConstructorKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: return true; default: return ts.isClassMemberModifier(kind); @@ -113727,7 +113607,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 325 /* SyntaxList */: + case 324 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -113895,11 +113775,11 @@ var ts; case 111 /* WhileKeyword */: case 86 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 130 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [130 /* ConstructorKeyword */]); - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [132 /* GetKeyword */, 143 /* SetKeyword */]); + case 129 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [129 /* ConstructorKeyword */]); + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [131 /* GetKeyword */, 142 /* SetKeyword */]); case 127 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 126 /* AsyncKeyword */: @@ -113947,7 +113827,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 291 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 290 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -113979,16 +113859,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 238 /* SwitchStatement */: - if (statement.kind === 234 /* ContinueStatement */) { + case 237 /* SwitchStatement */: + if (statement.kind === 233 /* ContinueStatement */) { return false; } // falls through - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -114004,11 +113884,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 224 /* Block */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 223 /* Block */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -114016,14 +113896,14 @@ var ts; else { return container.statements; } - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 173 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -114056,7 +113936,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 93 /* ForKeyword */, 111 /* WhileKeyword */, 86 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 229 /* DoStatement */) { + if (loopNode.kind === 228 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 111 /* WhileKeyword */)) { @@ -114076,13 +113956,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -114449,10 +114329,10 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 243 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 242 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 75 /* Identifier */) { directImports.push(name); @@ -114465,20 +114345,20 @@ var ts; break; case 75 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 256 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -114488,7 +114368,7 @@ var ts; directImports.push(direct); } break; - case 189 /* ImportType */: + case 188 /* ImportType */: directImports.push(direct); break; default: @@ -114505,7 +114385,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 291 /* SourceFile */ || sourceFileLike.kind === 250 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 290 /* SourceFile */ || sourceFileLike.kind === 249 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -114562,7 +114442,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 254 /* ImportEqualsDeclaration */) { + if (decl.kind === 253 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -114572,7 +114452,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 189 /* ImportType */) { + if (decl.kind === 188 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -114588,7 +114468,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 261 /* ExportDeclaration */) { + if (decl.kind === 260 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -114597,10 +114477,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -114650,7 +114530,7 @@ var ts; } } else { - var localSymbol = element.kind === 264 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 263 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -114679,7 +114559,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 291 /* SourceFile */) { + if (searchSourceFile.kind === 290 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -114727,7 +114607,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 291 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 290 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -114742,15 +114622,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 261 /* ExportDeclaration */: - case 255 /* ImportDeclaration */: { + case 260 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -114774,7 +114654,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 195 /* PropertyAccessExpression */) { + if (parent.kind === 194 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -114904,13 +114784,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -114943,21 +114823,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 291 /* SourceFile */) { + if (parent.kind === 290 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 251 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 250 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 249 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 266 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 265 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -115059,7 +114939,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -115067,27 +114947,27 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextNode(node.parent.parent); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; - case 264 /* ExportSpecifier */: - case 257 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -115148,13 +115028,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -115304,13 +115184,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 215 /* ClassExpression */) { + else if (node.kind === 214 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -115360,7 +115240,7 @@ var ts; return node.kind === 84 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node) - || (node.kind === 130 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); + || (node.kind === 129 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent)); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -115371,47 +115251,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 210 /* BinaryExpression */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 209 /* BinaryExpression */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: case 84 /* DefaultKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 264 /* ExportSpecifier */: - case 256 /* ImportClause */: // default import - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 247 /* InterfaceDeclaration */: - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 274 /* JsxAttribute */: - case 250 /* ModuleDeclaration */: - case 253 /* NamespaceExportDeclaration */: - case 257 /* NamespaceImport */: - case 263 /* NamespaceExport */: - case 157 /* Parameter */: - case 283 /* ShorthandPropertyAssignment */: - case 248 /* TypeAliasDeclaration */: - case 156 /* TypeParameter */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 263 /* ExportSpecifier */: + case 255 /* ImportClause */: // default import + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 246 /* InterfaceDeclaration */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 273 /* JsxAttribute */: + case 249 /* ModuleDeclaration */: + case 252 /* NamespaceExportDeclaration */: + case 256 /* NamespaceImport */: + case 262 /* NamespaceExport */: + case 156 /* Parameter */: + case 282 /* ShorthandPropertyAssignment */: + case 247 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: return true; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return !!decl.body; - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 161 /* MethodSignature */: - case 159 /* PropertySignature */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 160 /* MethodSignature */: + case 158 /* PropertySignature */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -115572,10 +115452,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -115604,9 +115484,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 139 /* ReadonlyKeyword */ + return node.kind === 138 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 139 /* ReadonlyKeyword */; + && node.parent.operator === 138 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -115617,12 +115497,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 139 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 138 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 139 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 138 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -115683,7 +115563,7 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: return 1 /* Constructor */; case 75 /* Identifier */: if (ts.isClassLike(node.parent)) { @@ -115923,7 +115803,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 202 /* FunctionExpression */ || valueDeclaration.kind === 215 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 201 /* FunctionExpression */ || valueDeclaration.kind === 214 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -115933,7 +115813,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 246 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 245 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -115962,7 +115842,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -116333,15 +116213,15 @@ var ts; if (constructorSymbol && constructorSymbol.declarations) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 130 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 163 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 129 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 162 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 162 /* MethodDeclaration */) { + if (decl && decl.kind === 161 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 104 /* ThisKeyword */, function (thisKeyword) { @@ -116365,7 +116245,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 163 /* Constructor */); + ts.Debug.assert(decl.kind === 162 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 102 /* SuperKeyword */, function (node) { @@ -116395,7 +116275,7 @@ var ts; if (refNode.kind !== 75 /* Identifier */) { return; } - if (refNode.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 282 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -116415,7 +116295,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 224 /* Block */) { + if (body.kind === 223 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -116443,13 +116323,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 193 /* ArrayLiteralExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 192 /* ArrayLiteralExpression */: return true; default: return false; @@ -116502,13 +116382,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -116529,41 +116409,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 75 /* Identifier */ && node.parent.kind === 157 /* Parameter */ && node.parent.name === node; + return node.kind === 75 /* Identifier */ && node.parent.kind === 156 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 291 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 290 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -116571,19 +116451,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 291 /* SourceFile */: - return container.kind === 291 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 290 /* SourceFile */: + return container.kind === 290 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -116666,7 +116546,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 264 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 263 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -116711,7 +116591,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 192 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 191 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -117107,55 +116987,55 @@ var ts; } switch (node.kind) { case 75 /* Identifier */: - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 197 /* CallExpression */: + case 196 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 198 /* NewExpression */: + case 197 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 158 /* Decorator */: + case 157 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -117205,22 +117085,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -117517,7 +117397,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -117686,11 +117566,11 @@ var ts; return true; } switch (declaration.kind) { - case 256 /* ImportClause */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: return true; - case 259 /* ImportSpecifier */: - return declaration.parent.kind === 258 /* NamedImports */; + case 258 /* ImportSpecifier */: + return declaration.parent.kind === 257 /* NamedImports */; default: return false; } @@ -117704,7 +117584,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 130 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 129 /* ConstructorKeyword */)) { var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -117777,9 +117657,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return true; default: return false; @@ -117897,11 +117777,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return [declaration]; - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -117922,18 +117802,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return withNode(tag.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return withNode(tag.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -118102,23 +117982,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 160 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 159 /* PropertySignature */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 158 /* PropertySignature */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 247 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -118126,14 +118006,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 291 /* SourceFile */: + case 290 /* SourceFile */: return "quit"; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 250 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 210 /* BinaryExpression */: { + return commentOwner.parent.kind === 249 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 209 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -118141,7 +118021,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -118157,14 +118037,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 201 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 200 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return rightHandSide.parameters; - case 215 /* ClassExpression */: { + case 214 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -118226,9 +118106,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 253 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -118238,7 +118118,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 155 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 154 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -118255,7 +118135,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 155 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 154 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -118462,7 +118342,7 @@ var ts; return; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -118474,21 +118354,21 @@ var ts; } } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 160 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -118500,7 +118380,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -118511,17 +118391,17 @@ var ts; } } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: + case 242 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -118536,7 +118416,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -118544,11 +118424,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -118558,9 +118438,9 @@ var ts; } endNode(); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -118568,20 +118448,20 @@ var ts; } endNode(); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 260 /* ExportAssignment */: - case 264 /* ExportSpecifier */: - case 254 /* ImportEqualsDeclaration */: - case 168 /* IndexSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 248 /* TypeAliasDeclaration */: + case 259 /* ExportAssignment */: + case 263 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 167 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 247 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -118823,12 +118703,12 @@ var ts; return false; } switch (a.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -118844,7 +118724,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 250 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 249 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -118874,7 +118754,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -118883,16 +118763,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 250 /* ModuleDeclaration */) { + if (node.kind === 249 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -118904,18 +118784,18 @@ var ts; } } switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -118923,13 +118803,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return "new()"; - case 166 /* CallSignature */: + case 165 /* CallSignature */: return "()"; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "[]"; default: return ""; @@ -118962,19 +118842,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 291 /* SourceFile */: - case 248 /* TypeAliasDeclaration */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 290 /* SourceFile */: + case 247 /* TypeAliasDeclaration */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: return true; - case 203 /* ArrowFunction */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -118984,10 +118864,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 251 /* ModuleBlock */: - case 291 /* SourceFile */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: + case 250 /* ModuleBlock */: + case 290 /* SourceFile */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: return true; default: return false; @@ -119047,7 +118927,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -119061,13 +118941,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 155 /* ComputedPropertyName */; + return !member.name || member.name.kind === 154 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 291 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 290 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 243 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 242 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -119125,9 +119005,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: return true; default: return false; @@ -119635,7 +119515,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -119643,16 +119523,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 229 /* DoStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 281 /* CatchClause */: + case 228 /* DoStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 280 /* CatchClause */: return spanForNode(n.parent); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -119669,29 +119549,29 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanForNode(n.parent); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 252 /* CaseBlock */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 251 /* CaseBlock */: return spanForNode(n); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return spanForNodeArray(n.statements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return spanForJSXElement(n); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return spanForJSXFragment(n); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); } @@ -119743,7 +119623,7 @@ var ts; ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 203 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 202 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -120278,10 +120158,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 131 /* DeclareKeyword */) { + if (token === 130 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 136 /* ModuleKeyword */) { + if (token === 135 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -120317,7 +120197,7 @@ var ts; else { if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -120348,7 +120228,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -120364,7 +120244,7 @@ var ts; token = nextToken(); if (token === 75 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -120394,7 +120274,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -120406,7 +120286,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 150 /* FromKeyword */) { + if (token === 149 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -120432,7 +120312,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 140 /* RequireKeyword */) { + if (token === 139 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -120593,7 +120473,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 155 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 154 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -120805,14 +120685,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 139 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 138 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 156 /* TypeParameter */ || + kind === 155 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -120919,7 +120799,7 @@ var ts; } function createSyntaxList(children) { ts.Debug.assertGreaterThanOrEqual(children.length, 1); - var syntaxList = ts.createNode(325 /* SyntaxList */, children[0].pos, ts.last(children).end); + var syntaxList = ts.createNode(324 /* SyntaxList */, children[0].pos, ts.last(children).end); syntaxList._children = children; return syntaxList; } @@ -120928,14 +120808,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 269 /* JsxOpeningElement */; + || kind === 268 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 270 /* JsxClosingElement */; + || kind === 269 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -121140,10 +121020,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 199 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 198 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 212 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 211 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -121210,17 +121090,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 200 /* ParenthesizedExpression */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -121344,7 +121224,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -121691,11 +121571,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -121712,12 +121592,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 257 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 256 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -121775,9 +121655,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 100 /* NullKeyword */: @@ -121792,7 +121672,7 @@ var ts; } function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 202 /* FunctionExpression */) { + if (node.kind === 201 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } @@ -121800,7 +121680,7 @@ var ts; var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 245 /* FunctionDeclaration */) { + if (node.kind === 244 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -121819,7 +121699,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -121905,11 +121785,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 269 /* JsxOpeningElement */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: return location.kind === 75 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -121953,7 +121833,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 195 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 194 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -121973,7 +121853,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 198 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 197 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 102 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -122029,29 +121909,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 130 /* ConstructorKeyword */ && location.parent.kind === 163 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 129 /* ConstructorKeyword */ && location.parent.kind === 162 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 130 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 129 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 163 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 162 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 163 /* Constructor */) { + if (functionDeclaration_1.kind === 162 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 166 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 165 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -122062,7 +121942,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 215 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 214 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -122085,7 +121965,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -122106,9 +121986,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 250 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 249 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 75 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 137 /* NamespaceKeyword */ : 136 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 136 /* NamespaceKeyword */ : 135 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -122127,7 +122007,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 156 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 155 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -122135,21 +122015,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 167 /* ConstructSignature */) { + if (declaration.kind === 166 /* ConstructSignature */) { displayParts.push(ts.keywordPart(99 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 166 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 165 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 248 /* TypeAliasDeclaration */) { + else if (declaration.kind === 247 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(146 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(145 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -122161,7 +122041,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 285 /* EnumMember */) { + if (declaration.kind === 284 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -122191,17 +122071,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(137 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(136 /* NamespaceKeyword */)); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 84 /* DefaultKeyword */)); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: displayParts.push(ts.keywordPart(89 /* ExportKeyword */)); break; default: @@ -122210,13 +122090,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 254 /* ImportEqualsDeclaration */) { + if (declaration.kind === 253 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(139 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -122289,10 +122169,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 291 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 290 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 210 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 209 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -122410,16 +122290,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 202 /* FunctionExpression */) { + if (declaration.kind === 201 /* FunctionExpression */) { return true; } - if (declaration.kind !== 243 /* VariableDeclaration */ && declaration.kind !== 245 /* FunctionDeclaration */) { + if (declaration.kind !== 242 /* VariableDeclaration */ && declaration.kind !== 244 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 291 /* SourceFile */ || parent.kind === 251 /* ModuleBlock */) { + if (parent.kind === 290 /* SourceFile */ || parent.kind === 250 /* ModuleBlock */) { return false; } } @@ -122719,10 +122599,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 274 /* JsxAttribute */: - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 273 /* JsxAttribute */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 75 /* Identifier */; } @@ -122914,7 +122794,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 153 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 152 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -122929,9 +122809,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 153 /* LastKeyword */); + var keywords = tokenRangeFromRange(77 /* FirstKeyword */, 152 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 74 /* LastBinaryOperator */); - var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 153 /* OfKeyword */, 123 /* AsKeyword */, 134 /* IsKeyword */]; + var binaryKeywordOperators = [97 /* InKeyword */, 98 /* InstanceOfKeyword */, 152 /* OfKeyword */, 123 /* AsKeyword */, 133 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 75 /* Identifier */, 20 /* OpenParenToken */, @@ -123005,7 +122885,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [132 /* GetKeyword */, 143 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [131 /* GetKeyword */, 142 /* SetKeyword */], 75 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 121 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [121 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 101 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -123029,34 +122909,34 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [136 /* ModuleKeyword */, 140 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [135 /* ModuleKeyword */, 139 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 122 /* AbstractKeyword */, 80 /* ClassKeyword */, - 131 /* DeclareKeyword */, + 130 /* DeclareKeyword */, 84 /* DefaultKeyword */, 88 /* EnumKeyword */, 89 /* ExportKeyword */, 90 /* ExtendsKeyword */, - 132 /* GetKeyword */, + 131 /* GetKeyword */, 113 /* ImplementsKeyword */, 96 /* ImportKeyword */, 114 /* InterfaceKeyword */, - 136 /* ModuleKeyword */, - 137 /* NamespaceKeyword */, + 135 /* ModuleKeyword */, + 136 /* NamespaceKeyword */, 117 /* PrivateKeyword */, 119 /* PublicKeyword */, 118 /* ProtectedKeyword */, - 139 /* ReadonlyKeyword */, - 143 /* SetKeyword */, + 138 /* ReadonlyKeyword */, + 142 /* SetKeyword */, 120 /* StaticKeyword */, - 146 /* TypeKeyword */, - 150 /* FromKeyword */, - 135 /* KeyOfKeyword */, - 133 /* InferKeyword */, + 145 /* TypeKeyword */, + 149 /* FromKeyword */, + 134 /* KeyOfKeyword */, + 132 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 150 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [90 /* ExtendsKeyword */, 113 /* ImplementsKeyword */, 149 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -123087,8 +122967,8 @@ var ts; 119 /* PublicKeyword */, 117 /* PrivateKeyword */, 118 /* ProtectedKeyword */, - 132 /* GetKeyword */, - 143 /* SetKeyword */, + 131 /* GetKeyword */, + 142 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -123099,8 +122979,8 @@ var ts; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("NoSpaceAfterConstructor", 130 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("SpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("NoSpaceAfterConstructor", 129 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */), // Insert space after function keyword for anonymous functions @@ -123242,51 +123122,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 231 /* ForStatement */; + return context.contextNode.kind === 230 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 211 /* ConditionalExpression */: - case 181 /* ConditionalType */: - case 218 /* AsExpression */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 169 /* TypePredicate */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 210 /* ConditionalExpression */: + case 180 /* ConditionalType */: + case 217 /* AsExpression */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 168 /* TypePredicate */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 192 /* BindingElement */: + case 191 /* BindingElement */: // equals in type X = ... // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: // equal in p = 0 // falls through - case 157 /* Parameter */: - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return context.currentTokenSpan.kind === 97 /* InKeyword */ || context.nextTokenSpan.kind === 97 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 233 /* ForOfStatement */: - return context.currentTokenSpan.kind === 153 /* OfKeyword */ || context.nextTokenSpan.kind === 153 /* OfKeyword */; + case 232 /* ForOfStatement */: + return context.currentTokenSpan.kind === 152 /* OfKeyword */ || context.nextTokenSpan.kind === 152 /* OfKeyword */; } return false; } @@ -123298,22 +123178,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 160 /* PropertyDeclaration */ || - contextKind === 159 /* PropertySignature */ || - contextKind === 157 /* Parameter */ || - contextKind === 243 /* VariableDeclaration */ || + return contextKind === 159 /* PropertyDeclaration */ || + contextKind === 158 /* PropertySignature */ || + contextKind === 156 /* Parameter */ || + contextKind === 242 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 211 /* ConditionalExpression */ || - context.contextNode.kind === 181 /* ConditionalType */; + return context.contextNode.kind === 210 /* ConditionalExpression */ || + context.contextNode.kind === 180 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 190 /* ObjectBindingPattern */ || - context.contextNode.kind === 187 /* MappedType */ || + return context.contextNode.kind === 189 /* ObjectBindingPattern */ || + context.contextNode.kind === 186 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -123339,34 +123219,34 @@ var ts; return true; } switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 194 /* ObjectLiteralExpression */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 193 /* ObjectLiteralExpression */: + case 250 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 166 /* CallSignature */: - case 202 /* FunctionExpression */: - case 163 /* Constructor */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 201 /* FunctionExpression */: + case 162 /* Constructor */: + case 202 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 247 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 246 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -123375,40 +123255,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 245 /* FunctionDeclaration */ || context.contextNode.kind === 202 /* FunctionExpression */; + return context.contextNode.kind === 244 /* FunctionDeclaration */ || context.contextNode.kind === 201 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 174 /* TypeLiteral */: - case 250 /* ModuleDeclaration */: - case 261 /* ExportDeclaration */: - case 262 /* NamedExports */: - case 255 /* ImportDeclaration */: - case 258 /* NamedImports */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 173 /* TypeLiteral */: + case 249 /* ModuleDeclaration */: + case 260 /* ExportDeclaration */: + case 261 /* NamedExports */: + case 254 /* ImportDeclaration */: + case 257 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 281 /* CatchClause */: - case 251 /* ModuleBlock */: - case 238 /* SwitchStatement */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 280 /* CatchClause */: + case 250 /* ModuleBlock */: + case 237 /* SwitchStatement */: return true; - case 224 /* Block */: { + case 223 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 203 /* ArrowFunction */ && blockParent.kind !== 202 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 202 /* ArrowFunction */ && blockParent.kind !== 201 /* FunctionExpression */) { return true; } } @@ -123417,32 +123297,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 237 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 236 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 194 /* ObjectLiteralExpression */; + return context.contextNode.kind === 193 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 197 /* CallExpression */; + return context.contextNode.kind === 196 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 198 /* NewExpression */; + return context.contextNode.kind === 197 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -123457,28 +123337,28 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 203 /* ArrowFunction */; + return context.contextNode.kind === 202 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 189 /* ImportType */; + return context.contextNode.kind === 188 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 267 /* JsxElement */ && context.contextNode.kind !== 271 /* JsxFragment */; + return context.contextNode.kind !== 266 /* JsxElement */ && context.contextNode.kind !== 270 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 277 /* JsxExpression */ || context.contextNode.kind === 276 /* JsxSpreadAttribute */; + return context.contextNode.kind === 276 /* JsxExpression */ || context.contextNode.kind === 275 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 274 /* JsxAttribute */; + return context.nextTokenParent.kind === 273 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 274 /* JsxAttribute */; + return context.contextNode.kind === 273 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 268 /* JsxSelfClosingElement */; + return context.contextNode.kind === 267 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -123493,45 +123373,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 244 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 243 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 250 /* ModuleDeclaration */; + return context.contextNode.kind === 249 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 174 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 173 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 167 /* ConstructSignature */; + return context.contextNode.kind === 166 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 170 /* TypeReference */: - case 200 /* TypeAssertionExpression */: - case 248 /* TypeAliasDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 199 /* TypeAssertionExpression */: + case 247 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -123542,28 +123422,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 200 /* TypeAssertionExpression */; + return context.contextNode.kind === 199 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 206 /* VoidExpression */; + return context.currentTokenSpan.kind === 110 /* VoidKeyword */ && context.currentTokenParent.kind === 205 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 213 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 212 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 219 /* NonNullExpression */; + return context.contextNode.kind === 218 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 228 /* IfStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 227 /* IfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; default: return false; @@ -123588,12 +123468,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 223 /* SemicolonClassElement */ || + if (nextTokenKind === 222 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 247 /* InterfaceDeclaration */ || - context.contextNode.kind === 248 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 246 /* InterfaceDeclaration */ || + context.contextNode.kind === 247 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -123607,9 +123487,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 231 /* ForStatement */ - && context.currentTokenParent.kind !== 225 /* EmptyStatement */ - && context.currentTokenParent.kind !== 223 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 230 /* ForStatement */ + && context.currentTokenParent.kind !== 224 /* EmptyStatement */ + && context.currentTokenParent.kind !== 222 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -123617,7 +123497,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 212 /* TemplateExpression */ + && nextTokenKind !== 211 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -123708,12 +123588,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 153 /* LastKeyword */ && column <= 153 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 152 /* LastKeyword */ && column <= 152 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 153 /* LastToken */ + 1; + var mapRowLength = 152 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -123901,17 +123781,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 251 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 291 /* SourceFile */: - case 224 /* Block */: - case 251 /* ModuleBlock */: + return !!body && body.kind === 250 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 290 /* SourceFile */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -124138,19 +124018,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 246 /* ClassDeclaration */: return 80 /* ClassKeyword */; - case 247 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; - case 245 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; - case 249 /* EnumDeclaration */: return 249 /* EnumDeclaration */; - case 164 /* GetAccessor */: return 132 /* GetKeyword */; - case 165 /* SetAccessor */: return 143 /* SetKeyword */; - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: return 80 /* ClassKeyword */; + case 246 /* InterfaceDeclaration */: return 114 /* InterfaceKeyword */; + case 244 /* FunctionDeclaration */: return 94 /* FunctionKeyword */; + case 248 /* EnumDeclaration */: return 248 /* EnumDeclaration */; + case 163 /* GetAccessor */: return 131 /* GetKeyword */; + case 164 /* SetAccessor */: return 142 /* SetKeyword */; + case 161 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -124207,15 +124087,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 187 /* MappedType */) { + if (container.kind !== 186 /* MappedType */) { return false; } break; @@ -124318,7 +124198,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 158 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 157 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -124338,7 +124218,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 193 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 192 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -124781,12 +124661,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 203 /* ArrowFunction */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 202 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -124794,8 +124674,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -124803,12 +124683,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 170 /* TypeReference */: + case 169 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -124926,7 +124806,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 210 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 209 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -125080,7 +124960,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 291 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 290 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -125128,7 +125008,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 228 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 227 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 87 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -125166,40 +125046,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getList(node.typeArguments); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return getList(node.properties); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getList(node.elements); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return getList(node.members); - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 163 /* Constructor */: - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 162 /* Constructor */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 198 /* NewExpression */: - case 197 /* CallExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return getList(node.declarations); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return getList(node.elements); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -125222,7 +125102,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 244 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 243 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -125295,87 +125175,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 227 /* ExpressionStatement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 193 /* ArrayLiteralExpression */: - case 224 /* Block */: - case 251 /* ModuleBlock */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 187 /* MappedType */: - case 176 /* TupleType */: - case 252 /* CaseBlock */: - case 279 /* DefaultClause */: - case 278 /* CaseClause */: - case 201 /* ParenthesizedExpression */: - case 195 /* PropertyAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 226 /* VariableStatement */: - case 260 /* ExportAssignment */: - case 236 /* ReturnStatement */: - case 211 /* ConditionalExpression */: - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: - case 268 /* JsxSelfClosingElement */: - case 277 /* JsxExpression */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 157 /* Parameter */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 183 /* ParenthesizedType */: - case 199 /* TaggedTemplateExpression */: - case 207 /* AwaitExpression */: - case 262 /* NamedExports */: - case 258 /* NamedImports */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 160 /* PropertyDeclaration */: + case 226 /* ExpressionStatement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 192 /* ArrayLiteralExpression */: + case 223 /* Block */: + case 250 /* ModuleBlock */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 186 /* MappedType */: + case 175 /* TupleType */: + case 251 /* CaseBlock */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: + case 200 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 225 /* VariableStatement */: + case 259 /* ExportAssignment */: + case 235 /* ReturnStatement */: + case 210 /* ConditionalExpression */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: + case 267 /* JsxSelfClosingElement */: + case 276 /* JsxExpression */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 156 /* Parameter */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 182 /* ParenthesizedType */: + case 198 /* TaggedTemplateExpression */: + case 206 /* AwaitExpression */: + case 261 /* NamedExports */: + case 257 /* NamedImports */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 159 /* PropertyDeclaration */: return true; - case 243 /* VariableDeclaration */: - case 282 /* PropertyAssignment */: - case 210 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 194 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 242 /* VariableDeclaration */: + case 281 /* PropertyAssignment */: + case 209 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 193 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 210 /* BinaryExpression */) { + if (parent.kind !== 209 /* BinaryExpression */) { return true; } break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 228 /* IfStatement */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return childKind !== 224 /* Block */; - case 261 /* ExportDeclaration */: - return childKind !== 262 /* NamedExports */; - case 255 /* ImportDeclaration */: - return childKind !== 256 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 258 /* NamedImports */); - case 267 /* JsxElement */: - return childKind !== 270 /* JsxClosingElement */; - case 271 /* JsxFragment */: - return childKind !== 273 /* JsxClosingFragment */; - case 180 /* IntersectionType */: - case 179 /* UnionType */: - if (childKind === 174 /* TypeLiteral */) { + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 227 /* IfStatement */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return childKind !== 223 /* Block */; + case 260 /* ExportDeclaration */: + return childKind !== 261 /* NamedExports */; + case 254 /* ImportDeclaration */: + return childKind !== 255 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 257 /* NamedImports */); + case 266 /* JsxElement */: + return childKind !== 269 /* JsxClosingElement */; + case 270 /* JsxFragment */: + return childKind !== 272 /* JsxClosingFragment */; + case 179 /* IntersectionType */: + case 178 /* UnionType */: + if (childKind === 173 /* TypeLiteral */) { return false; } // falls through @@ -125386,11 +125266,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: - return parent.kind !== 224 /* Block */; + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: + return parent.kind !== 223 /* Block */; default: return false; } @@ -125532,7 +125412,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 194 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 193 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -125718,7 +125598,7 @@ var ts; } } else { - endNode = node.kind !== 243 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 242 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -125872,18 +125752,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: case 10 /* StringLiteral */: case 75 /* Identifier */: return { prefix: ", " }; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 89 /* ExportKeyword */: return { prefix: " " }; - case 157 /* Parameter */: + case 156 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -125892,7 +125772,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 203 /* ArrowFunction */) { + if (node.kind === 202 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -125906,14 +125786,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 224 /* Block */) { + if (node.body.kind !== 223 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(101 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 202 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 201 /* FunctionExpression */ ? 94 /* FunctionKeyword */ : 80 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -126478,14 +126358,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 155 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 154 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 157 /* Parameter */: { + case 156 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -126500,15 +126380,15 @@ var ts; } break; } - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isImportDeclaration); deleteNode(changes, sourceFile, node, // For first import, leave header comment in place isFirstImport ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 191 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 190 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -126516,13 +126396,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -126531,7 +126411,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -126584,13 +126464,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 255 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 254 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 281 /* CatchClause */) { + if (parent.kind === 280 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -126601,14 +126481,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -126787,8 +126667,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(149 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(149 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(148 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(148 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127019,7 +126899,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 226 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 225 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -127097,10 +126977,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 245 /* FunctionDeclaration */ || - ancestor.parent.kind === 202 /* FunctionExpression */ || - ancestor.parent.kind === 203 /* ArrowFunction */ || - ancestor.parent.kind === 162 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 244 /* FunctionDeclaration */ || + ancestor.parent.kind === 201 /* FunctionExpression */ || + ancestor.parent.kind === 202 /* ArrowFunction */ || + ancestor.parent.kind === 161 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -127219,10 +127099,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 75 /* Identifier */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -127237,7 +127117,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 75 /* Identifier */: - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -127286,9 +127166,9 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 160 /* PropertyDeclaration */ && + if (declaration.kind === 159 /* PropertyDeclaration */ && (!fixedNodes || fixedNodes.tryAdd(declaration))) { - changeTracker.insertModifierBefore(sourceFile, 131 /* DeclareKeyword */, declaration); + changeTracker.insertModifierBefore(sourceFile, 130 /* DeclareKeyword */, declaration); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -127423,26 +127303,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 243 /* VariableDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 242 /* VariableDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 159 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -127464,7 +127344,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 302 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 301 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -127504,8 +127384,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 141 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 140 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -127539,12 +127419,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -127599,7 +127479,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 227 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 226 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -127607,7 +127487,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 126 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -127615,12 +127495,12 @@ var ts; ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 203 /* ArrowFunction */: { + case 202 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 224 /* Block */) { + if (arrowFunctionBody.kind === 223 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -127648,7 +127528,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 202 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 201 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 75 /* Identifier */) { @@ -128015,8 +127895,8 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -128221,10 +128101,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -128277,20 +128157,20 @@ var ts; } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 197 /* CallExpression */: { + case 196 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var operatorToken = expression.operatorToken; return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } @@ -128332,8 +128212,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: { + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -128384,16 +128264,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 283 /* ShorthandPropertyAssignment */: - case 284 /* SpreadAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 283 /* SpreadAssignment */: return undefined; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(89 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); @@ -128457,7 +128337,7 @@ var ts; function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.createToken(89 /* ExportKeyword */)]; switch (exported.kind) { - case 202 /* FunctionExpression */: { + case 201 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -128465,10 +128345,10 @@ var ts; } } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -128486,7 +128366,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -128499,7 +128379,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 191 /* ArrayBindingPattern */: { + case 190 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -128582,11 +128462,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return parent.propertyName !== node; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -129092,11 +128972,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -129106,11 +128986,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return declaration.name.text; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -129119,10 +128999,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 254 /* ImportEqualsDeclaration */) + if (declaration.kind === 253 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 243 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 190 /* ObjectBindingPattern */ + if (declaration.kind === 242 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 189 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -129130,7 +129010,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 258 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 257 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -129143,7 +129023,7 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 255 /* ImportDeclaration */ || i.kind === 254 /* ImportEqualsDeclaration */) { + if (i.kind === 254 /* ImportDeclaration */ || i.kind === 253 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); @@ -129186,9 +129066,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 255 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 243 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 266 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 254 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 242 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 265 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -129399,7 +129279,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 190 /* ObjectBindingPattern */) { + if (clause.kind === 189 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -130023,7 +129903,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 215 /* ClassExpression */) { + if (classDeclaration.kind === 214 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -130071,7 +129951,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 210 /* BinaryExpression */) { + if (token.parent.parent.kind === 209 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -130117,7 +129997,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(144 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(143 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -130141,7 +130021,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 162 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 161 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -130704,7 +130584,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -130736,7 +130616,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 133 /* InferKeyword */) + if (token.kind === 132 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -130755,7 +130635,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -130766,7 +130646,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(149 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(148 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -130782,7 +130662,7 @@ var ts; if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 157 /* Parameter */) { + if (decl.kind === 156 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -130793,7 +130673,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -130802,7 +130682,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 133 /* InferKeyword */) { + if (token.kind === 132 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -130811,14 +130691,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 157 /* Parameter */: - case 156 /* TypeParameter */: + case 156 /* Parameter */: + case 155 /* TypeParameter */: return true; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: return true; } } @@ -130865,17 +130745,17 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: return true; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: { + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. var parameters = parent.parameters; var index = parameters.indexOf(p); @@ -130884,7 +130764,7 @@ var ts; ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 75 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -130933,7 +130813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -130944,8 +130824,8 @@ var ts; return; } // falls through - case 230 /* WhileStatement */: - case 231 /* ForStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -131018,7 +130898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 298 /* JSDocNullableType */) { + if (typeNode.kind === 297 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -131038,7 +130918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 298 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 297 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -131055,22 +130935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 218 /* AsExpression */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 245 /* FunctionDeclaration */: - case 164 /* GetAccessor */: - case 168 /* IndexSignature */: - case 187 /* MappedType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 200 /* TypeAssertionExpression */: - case 243 /* VariableDeclaration */: + case 217 /* AsExpression */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 244 /* FunctionDeclaration */: + case 163 /* GetAccessor */: + case 167 /* IndexSignature */: + case 186 /* MappedType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 199 /* TypeAssertionExpression */: + case 242 /* VariableDeclaration */: return true; default: return false; @@ -131172,14 +131052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 94 /* FunctionKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -131452,7 +131332,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 159 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 158 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -131501,14 +131381,14 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 203 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 202 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 160 /* PropertyDeclaration */) { + if (signature.parent.kind === 159 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -131518,14 +131398,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 318 /* JSDocParameterTag */: { + case 317 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 319 /* JSDocReturnTag */: + case 318 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -131550,18 +131430,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 163 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 130 /* ConstructorKeyword */, sourceFile); + case 162 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 129 /* ConstructorKeyword */, sourceFile); break; - case 203 /* ArrowFunction */: - case 202 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 201 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -131703,24 +131583,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: addCandidateType(usage, checker.getVoidType()); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -131728,20 +131608,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -131860,7 +131740,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 243 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 242 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -131888,7 +131768,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 197 /* CallExpression */) { + if (parent.kind === 196 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -132104,9 +131984,6 @@ var ts; else if (genericType.flags & 3145728 /* UnionOrIntersection */) { return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); }); } - else if (genericType.flags & 134217728 /* Awaited */) { - return inferTypeParameters(genericType.awaitedType, usageType, typeParameter); - } else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) { // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference var genericArgs = checker.getTypeArguments(genericType); @@ -132123,7 +132000,6 @@ var ts; } var genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */); var usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */); - // allow for multiple overloads of `then`. if (genericSigs.length === 1 && usageSigs.length === 1) { return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); } @@ -132282,8 +132158,8 @@ var ts; var optional = !!(symbol.flags & 16777216 /* Optional */); var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); switch (declaration.kind) { - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: var flags = preferences.quotePreference === "single" ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -132297,8 +132173,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: { + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -132327,8 +132203,8 @@ var ts; } break; } - case 161 /* MethodSignature */: - case 162 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 161 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -132373,7 +132249,7 @@ var ts; var program = context.program; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 162 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 161 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -132635,7 +132511,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 197 /* CallExpression */ : 198 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 196 /* CallExpression */ : 197 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -132754,7 +132630,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(146 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -132930,7 +132806,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 96 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 189 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 188 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -132982,7 +132858,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(139 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(138 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -133183,16 +133059,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: { + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -133220,12 +133096,12 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 89 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(84 /* DefaultKeyword */)); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. @@ -133233,9 +133109,9 @@ var ts; break; } // falls through - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -133262,18 +133138,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: { + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 256 /* ImportClause */: { + case 255 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -133282,7 +133158,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 257 /* NamespaceImport */) { + else if (namedBindings.kind === 256 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -133303,11 +133179,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 259 /* ImportSpecifier */: { + case 258 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -133320,7 +133196,7 @@ var ts; } break; } - case 264 /* ExportSpecifier */: { + case 263 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -133353,8 +133229,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 257 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 257 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 256 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 256 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -133376,7 +133252,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 257 /* NamespaceImport */) { + if (toConvert.kind === 256 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -133723,20 +133599,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 160 /* PropertyDeclaration */) { + if (current.kind === 159 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 157 /* Parameter */) { + else if (current.kind === 156 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 163 /* Constructor */) { + if (ctorOrMethod.kind === 162 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 162 /* MethodDeclaration */) { + else if (current.kind === 161 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -133779,7 +133655,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 243 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 242 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -133791,13 +133667,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 102 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 197 /* CallExpression */) { + if (node.parent.kind === 196 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -133812,8 +133688,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -133825,21 +133701,21 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 228 /* IfStatement */: + case 227 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 224 /* Block */: - if (node.parent && node.parent.kind === 241 /* TryStatement */ && node.parent.finallyBlock === node) { + case 223 /* Block */: + if (node.parent && node.parent.kind === 240 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 279 /* DefaultClause */: - case 278 /* CaseClause */: + case 278 /* DefaultClause */: + case 277 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -133851,19 +133727,19 @@ var ts; break; } switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: { + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -133872,20 +133748,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 235 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 234 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -133939,7 +133815,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 157 /* Parameter */) { + if (current.kind === 156 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -133950,7 +133826,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 291 /* SourceFile */) { + if (current.kind === 290 /* SourceFile */) { return scopes; } } @@ -134040,32 +133916,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "constructor"; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return "arrow function"; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 246 /* ClassDeclaration */ + return scope.kind === 245 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 251 /* ModuleBlock */ + return scope.kind === 250 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -134285,9 +134161,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 147 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 146 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } } /** @@ -134316,7 +134192,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(120 /* StaticKeyword */)); } - modifiers.push(ts.createToken(139 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(138 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -134345,7 +134221,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 227 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 226 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( @@ -134364,7 +134240,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -134508,7 +134384,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 236 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 235 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -134686,7 +134562,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 245 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 244 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -135002,30 +134878,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 285 /* EnumMember */: + case 284 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 255 /* ImportDeclaration */ && - parent.kind !== 259 /* ImportSpecifier */; - case 214 /* SpreadElement */: - case 190 /* ObjectBindingPattern */: - case 192 /* BindingElement */: + return parent.kind !== 254 /* ImportDeclaration */ && + parent.kind !== 258 /* ImportSpecifier */; + case 213 /* SpreadElement */: + case 189 /* ObjectBindingPattern */: + case 191 /* BindingElement */: return false; case 75 /* Identifier */: - return parent.kind !== 192 /* BindingElement */ && - parent.kind !== 259 /* ImportSpecifier */ && - parent.kind !== 264 /* ExportSpecifier */; + return parent.kind !== 191 /* BindingElement */ && + parent.kind !== 258 /* ImportSpecifier */ && + parent.kind !== 263 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 224 /* Block */: - case 291 /* SourceFile */: - case 251 /* ModuleBlock */: - case 278 /* CaseClause */: + case 223 /* Block */: + case 290 /* SourceFile */: + case 250 /* ModuleBlock */: + case 277 /* CaseClause */: return true; default: return false; @@ -135189,7 +135065,7 @@ var ts; } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; - var node = ts.createNode(323 /* JSDocTypedefTag */); + var node = ts.createNode(322 /* JSDocTypedefTag */); node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 node.fullName = ts.createIdentifier(name); node.name = node.fullName; @@ -135197,10 +135073,10 @@ var ts; var templates = []; ts.forEach(typeParameters, function (typeParameter) { var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); - var template = ts.createNode(322 /* JSDocTemplateTag */); + var template = ts.createNode(321 /* JSDocTemplateTag */); template.tagName = ts.createIdentifier("template"); template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); - var parameter = ts.createNode(156 /* TypeParameter */); + var parameter = ts.createNode(155 /* TypeParameter */); parameter.name = typeParameter.name; template.typeParameters = ts.createNodeArray([parameter]); templates.push(template); @@ -135311,7 +135187,7 @@ var ts; isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 157 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 156 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -135454,11 +135330,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return true; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -135546,12 +135422,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 257 /* NamespaceImport */ ? + case 254 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 256 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node.name; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -135582,20 +135458,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 255 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 254 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 254 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 253 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -135665,15 +135541,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -135686,7 +135562,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 257 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 256 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -135698,7 +135574,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined, importDecl.importClause.isTypeOnly)); } - else if (namedBindings.kind === 258 /* NamedImports */) { + else if (namedBindings.kind === 257 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -135716,9 +135592,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -135845,13 +135721,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 254 /* ImportEqualsDeclaration */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: return true; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -135863,7 +135739,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -135873,9 +135749,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -135884,7 +135760,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 257 /* NamespaceImport */) { + if (namedBindings.kind === 256 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -135896,9 +135772,9 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return keep(name) ? name : undefined; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return name; - case 190 /* ObjectBindingPattern */: { + case 189 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined; @@ -135955,13 +135831,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -135969,17 +135845,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return cb(statement); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 227 /* ExpressionStatement */: { + case 226 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -135991,8 +135867,8 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -136003,9 +135879,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return d.parent.parent; - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -136038,23 +135914,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.createModifier(89 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -136065,18 +135941,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -136346,15 +136222,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -136364,7 +136240,7 @@ var ts; } break; // x["foo"](...) - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -136383,14 +136259,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -136432,11 +136308,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 163 /* Constructor */: + case 162 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -136444,8 +136320,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -136616,7 +136492,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -136624,7 +136500,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 84 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -136635,25 +136511,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 84 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return [functionDeclaration.name]; - case 163 /* Constructor */: - var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 130 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 215 /* ClassExpression */) { + case 162 /* Constructor */: + var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 129 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 214 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -136904,8 +136780,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 295 /* FirstJSDocNode */ || kid.kind > 324 /* LastJSDocNode */; }); - return child.kind < 154 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 294 /* FirstJSDocNode */ || kid.kind > 323 /* LastJSDocNode */; }); + return child.kind < 153 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -136916,7 +136792,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 154 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 153 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -136974,7 +136850,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(325 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(324 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -137288,7 +137164,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 291 /* SourceFile */; + _this.kind = 290 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -137347,10 +137223,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -137370,31 +137246,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 264 /* ExportSpecifier */: - case 259 /* ImportSpecifier */: - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 174 /* TypeLiteral */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 263 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 173 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: { + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -137405,12 +137281,12 @@ var ts; } } // falls through - case 285 /* EnumMember */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 284 /* EnumMember */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: addDeclaration(node); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -137423,7 +137299,7 @@ var ts; } } break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -137435,7 +137311,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -137444,7 +137320,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -138063,12 +137939,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 102 /* SuperKeyword */: return true; default: @@ -138170,15 +138046,15 @@ var ts; return undefined; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: case 10 /* StringLiteral */: case 91 /* FalseKeyword */: case 106 /* TrueKeyword */: case 100 /* NullKeyword */: case 102 /* SuperKeyword */: case 104 /* ThisKeyword */: - case 184 /* ThisType */: + case 183 /* ThisType */: case 75 /* Identifier */: break; // Cant create the text span @@ -138195,7 +138071,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 250 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 249 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -138672,7 +138548,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 266 /* ExternalModuleReference */ || + node.parent.kind === 265 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -138690,13 +138566,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 155 /* ComputedPropertyName */) { + if (node.parent.kind === 154 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 75 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 194 /* ObjectLiteralExpression */ || node.parent.parent.kind === 275 /* JsxAttributes */) && + (node.parent.parent.kind === 193 /* ObjectLiteralExpression */ || node.parent.parent.kind === 274 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -138738,7 +138614,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 196 /* ElementAccessExpression */ && + node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -138818,114 +138694,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 243 /* VariableDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return spanInVariableDeclaration(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return spanInParameterDeclaration(node); - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return spanInBlock(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInBlock(node.block); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 229 /* DoStatement */: + case 228 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return spanInForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 241 /* TryStatement */: + case 240 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 192 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 191 /* BindingElement */: // span on complete node return textSpan(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 158 /* Decorator */: + case 157 /* Decorator */: return spanInNodeArray(parent.decorators); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -138955,7 +138831,7 @@ var ts; case 79 /* CatchKeyword */: case 92 /* FinallyKeyword */: return spanInNextNode(node); - case 153 /* OfKeyword */: + case 152 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -138968,13 +138844,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 75 /* Identifier */ || - node.kind === 214 /* SpreadElement */ || - node.kind === 282 /* PropertyAssignment */ || - node.kind === 283 /* ShorthandPropertyAssignment */) && + node.kind === 213 /* SpreadElement */ || + node.kind === 281 /* PropertyAssignment */ || + node.kind === 282 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -138996,22 +138872,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 158 /* Decorator */: + case 157 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return textSpan(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -139020,21 +138896,21 @@ var ts; } } switch (node.parent.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: { + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -139042,7 +138918,7 @@ var ts; } break; } - case 210 /* BinaryExpression */: { + case 209 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -139072,7 +138948,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 232 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 231 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -139084,7 +138960,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 233 /* ForOfStatement */) { + parent.parent.kind === 232 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -139125,7 +139001,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 246 /* ClassDeclaration */ && functionDeclaration.kind !== 163 /* Constructor */); + (functionDeclaration.parent.kind === 245 /* ClassDeclaration */ && functionDeclaration.kind !== 162 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -139148,26 +139024,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 232 /* ForInStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 231 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 243 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -139192,21 +139068,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 192 /* BindingElement */) { + if (bindingPattern.parent.kind === 191 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 191 /* ArrayBindingPattern */ && node.kind !== 190 /* ObjectBindingPattern */); - var elements = node.kind === 193 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 216 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 190 /* ArrayBindingPattern */ && node.kind !== 189 /* ObjectBindingPattern */); + var elements = node.kind === 192 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 215 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -139214,18 +139090,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 210 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 209 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -139233,25 +139109,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 249 /* EnumDeclaration */: - case 246 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 224 /* Block */: + case 223 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 281 /* CatchClause */: + case 280 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -139259,7 +139135,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139275,7 +139151,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -139290,12 +139166,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 229 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 197 /* CallExpression */ || - node.parent.kind === 198 /* NewExpression */) { + if (node.parent.kind === 228 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 196 /* CallExpression */ || + node.parent.kind === 197 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 201 /* ParenthesizedExpression */) { + if (node.parent.kind === 200 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -139304,21 +139180,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 201 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 200 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -139328,20 +139204,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ || - node.parent.kind === 157 /* Parameter */) { + node.parent.kind === 281 /* PropertyAssignment */ || + node.parent.kind === 156 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 200 /* TypeAssertionExpression */) { + if (node.parent.kind === 199 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 229 /* DoStatement */) { + if (node.parent.kind === 228 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -139349,7 +139225,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.kind === 232 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 93af1388141..3c939a470a7 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -3042,234 +3042,233 @@ var ts; SyntaxKind[SyntaxKind["AnyKeyword"] = 125] = "AnyKeyword"; SyntaxKind[SyntaxKind["AsyncKeyword"] = 126] = "AsyncKeyword"; SyntaxKind[SyntaxKind["AwaitKeyword"] = 127] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["AwaitedKeyword"] = 128] = "AwaitedKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 129] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 130] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 131] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 132] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 133] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 134] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 135] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 136] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 137] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 138] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 139] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 140] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 141] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 142] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 143] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 144] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 145] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 146] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 147] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 148] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 149] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 150] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 151] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 152] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 153] = "OfKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 128] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 129] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 130] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 131] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 132] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 133] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 134] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 135] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 136] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 137] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 138] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 139] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 140] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 141] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 142] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 143] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 144] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 145] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 146] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 147] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 148] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 149] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 150] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 151] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 152] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 154] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 155] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 153] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 154] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 156] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 157] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 158] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 155] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 156] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 157] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 159] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 160] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 161] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 162] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 163] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 164] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 165] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 166] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 167] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 168] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 158] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 159] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 160] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 161] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 162] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 163] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 164] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 165] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 166] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 167] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 169] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 170] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 171] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 172] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 173] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 174] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 175] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 176] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 177] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 178] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 179] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 180] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 181] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 182] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 183] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 184] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 185] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 186] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 187] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 188] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 189] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 168] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 169] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 170] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 171] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 172] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 173] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 174] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 175] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 176] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 177] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 178] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 179] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 180] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 181] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 182] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 183] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 184] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 185] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 186] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 187] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 188] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 190] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 191] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 192] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 189] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 190] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 191] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 193] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 194] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 195] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 196] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 197] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 198] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 199] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 200] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 201] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 202] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 203] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 204] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 205] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 206] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 207] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 208] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 209] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 210] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 211] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 212] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 213] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 214] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 215] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 216] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 217] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 218] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 219] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 220] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 221] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 192] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 193] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 194] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 195] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 196] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 197] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 198] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 199] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 200] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 201] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 202] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 203] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 204] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 205] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 206] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 207] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 208] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 209] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 210] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 211] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 212] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 213] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 214] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 215] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 216] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 217] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 218] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 219] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 220] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 222] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 223] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 221] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 222] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 224] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 225] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 226] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 227] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 228] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 229] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 230] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 231] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 232] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 233] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 234] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 235] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 236] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 237] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 238] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 239] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 240] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 241] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 242] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 243] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 244] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 245] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 246] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 247] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 248] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 249] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 250] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 251] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 252] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 253] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 254] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 255] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 256] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 257] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 258] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 259] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 260] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 261] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 262] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 263] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 264] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 265] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 223] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 224] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 225] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 226] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 227] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 228] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 229] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 230] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 231] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 232] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 233] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 234] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 235] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 236] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 237] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 238] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 239] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 240] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 241] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 242] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 243] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 244] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 245] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 246] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 247] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 248] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 249] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 250] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 251] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 252] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 253] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 254] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 255] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 256] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 257] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 258] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 259] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 260] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 261] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 262] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 263] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 264] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 266] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 265] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 267] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 268] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 269] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 270] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 271] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 272] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 273] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 274] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 275] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 276] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 277] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 266] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 267] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 268] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 269] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 270] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 271] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 272] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 273] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 274] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 275] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 276] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 278] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 279] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 280] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 281] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 277] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 278] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 279] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 280] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 282] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 283] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 284] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 281] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 282] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 283] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 285] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 284] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 286] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 287] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 288] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 289] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 290] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 285] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 286] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 287] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 288] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 289] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 291] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 292] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 293] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 294] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 290] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 291] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 292] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 293] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 295] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 294] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 296] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 295] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 297] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 298] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 299] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 300] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 301] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 302] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 296] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 297] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 298] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 299] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 300] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 301] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 303] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 304] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 305] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 306] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 307] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 308] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 309] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 310] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 311] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 312] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 313] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 314] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 315] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 316] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 317] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 318] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 319] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 320] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 321] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 322] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 323] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 324] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 302] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 303] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 304] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 305] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 306] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 307] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 308] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 309] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 310] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 311] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 312] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 313] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 314] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 315] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 316] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 317] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 318] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 319] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 320] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 321] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 322] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 323] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 325] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 324] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 326] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 327] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 328] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 329] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 330] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 331] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 325] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 326] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 327] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 328] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 329] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 330] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 332] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 331] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 74] = "LastAssignment"; @@ -3278,15 +3277,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 77] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 112] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 77] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 153] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 152] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 113] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 121] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 169] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 189] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 168] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 188] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 74] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 153] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 152] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -3295,15 +3294,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 74] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 226] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 242] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 154] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 295] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 324] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 307] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 324] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 225] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 241] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 153] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 294] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 323] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 306] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 323] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 122] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 153] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 152] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3849,7 +3848,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["Awaited"] = 134217728] = "Awaited"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -3878,10 +3876,10 @@ var ts; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; - TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 193200128] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 197394432] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 201064448] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ @@ -3890,10 +3888,10 @@ var ts; TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 268188671] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 201211939] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; @@ -8047,8 +8045,8 @@ var ts; any: 125 /* AnyKeyword */, as: 123 /* AsKeyword */, asserts: 124 /* AssertsKeyword */, - bigint: 152 /* BigIntKeyword */, - boolean: 129 /* BooleanKeyword */, + bigint: 151 /* BigIntKeyword */, + boolean: 128 /* BooleanKeyword */, break: 77 /* BreakKeyword */, case: 78 /* CaseKeyword */, catch: 79 /* CatchKeyword */, @@ -8056,9 +8054,9 @@ var ts; continue: 82 /* ContinueKeyword */, const: 81 /* ConstKeyword */ }, - _a["" + "constructor"] = 130 /* ConstructorKeyword */, + _a["" + "constructor"] = 129 /* ConstructorKeyword */, _a.debugger = 83 /* DebuggerKeyword */, - _a.declare = 131 /* DeclareKeyword */, + _a.declare = 130 /* DeclareKeyword */, _a.default = 84 /* DefaultKeyword */, _a.delete = 85 /* DeleteKeyword */, _a.do = 86 /* DoKeyword */, @@ -8069,49 +8067,49 @@ var ts; _a.false = 91 /* FalseKeyword */, _a.finally = 92 /* FinallyKeyword */, _a.for = 93 /* ForKeyword */, - _a.from = 150 /* FromKeyword */, + _a.from = 149 /* FromKeyword */, _a.function = 94 /* FunctionKeyword */, - _a.get = 132 /* GetKeyword */, + _a.get = 131 /* GetKeyword */, _a.if = 95 /* IfKeyword */, _a.implements = 113 /* ImplementsKeyword */, _a.import = 96 /* ImportKeyword */, _a.in = 97 /* InKeyword */, - _a.infer = 133 /* InferKeyword */, + _a.infer = 132 /* InferKeyword */, _a.instanceof = 98 /* InstanceOfKeyword */, _a.interface = 114 /* InterfaceKeyword */, - _a.is = 134 /* IsKeyword */, - _a.keyof = 135 /* KeyOfKeyword */, + _a.is = 133 /* IsKeyword */, + _a.keyof = 134 /* KeyOfKeyword */, _a.let = 115 /* LetKeyword */, - _a.module = 136 /* ModuleKeyword */, - _a.namespace = 137 /* NamespaceKeyword */, - _a.never = 138 /* NeverKeyword */, + _a.module = 135 /* ModuleKeyword */, + _a.namespace = 136 /* NamespaceKeyword */, + _a.never = 137 /* NeverKeyword */, _a.new = 99 /* NewKeyword */, _a.null = 100 /* NullKeyword */, - _a.number = 141 /* NumberKeyword */, - _a.object = 142 /* ObjectKeyword */, + _a.number = 140 /* NumberKeyword */, + _a.object = 141 /* ObjectKeyword */, _a.package = 116 /* PackageKeyword */, _a.private = 117 /* PrivateKeyword */, _a.protected = 118 /* ProtectedKeyword */, _a.public = 119 /* PublicKeyword */, - _a.readonly = 139 /* ReadonlyKeyword */, - _a.require = 140 /* RequireKeyword */, - _a.global = 151 /* GlobalKeyword */, + _a.readonly = 138 /* ReadonlyKeyword */, + _a.require = 139 /* RequireKeyword */, + _a.global = 150 /* GlobalKeyword */, _a.return = 101 /* ReturnKeyword */, - _a.set = 143 /* SetKeyword */, + _a.set = 142 /* SetKeyword */, _a.static = 120 /* StaticKeyword */, - _a.string = 144 /* StringKeyword */, + _a.string = 143 /* StringKeyword */, _a.super = 102 /* SuperKeyword */, _a.switch = 103 /* SwitchKeyword */, - _a.symbol = 145 /* SymbolKeyword */, + _a.symbol = 144 /* SymbolKeyword */, _a.this = 104 /* ThisKeyword */, _a.throw = 105 /* ThrowKeyword */, _a.true = 106 /* TrueKeyword */, _a.try = 107 /* TryKeyword */, - _a.type = 146 /* TypeKeyword */, + _a.type = 145 /* TypeKeyword */, _a.typeof = 108 /* TypeOfKeyword */, - _a.undefined = 147 /* UndefinedKeyword */, - _a.unique = 148 /* UniqueKeyword */, - _a.unknown = 149 /* UnknownKeyword */, + _a.undefined = 146 /* UndefinedKeyword */, + _a.unique = 147 /* UniqueKeyword */, + _a.unknown = 148 /* UnknownKeyword */, _a.var = 109 /* VarKeyword */, _a.void = 110 /* VoidKeyword */, _a.while = 111 /* WhileKeyword */, @@ -8119,8 +8117,7 @@ var ts; _a.yield = 121 /* YieldKeyword */, _a.async = 126 /* AsyncKeyword */, _a.await = 127 /* AwaitKeyword */, - _a.awaited = 128 /* AwaitedKeyword */, - _a.of = 153 /* OfKeyword */, + _a.of = 152 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); var textToToken = ts.createMapFromTemplate(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 74 /* CaretEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ })); @@ -10474,9 +10471,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 156 /* TypeParameter */) { + if (d && d.kind === 155 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 247 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 246 /* InterfaceDeclaration */) { return current; } } @@ -10484,7 +10481,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 163 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 162 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -10514,14 +10511,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 243 /* VariableDeclaration */) { + if (node.kind === 242 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 244 /* VariableDeclarationList */) { + if (node && node.kind === 243 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 226 /* VariableStatement */) { + if (node && node.kind === 225 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -10670,30 +10667,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 210 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 209 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return expr.name; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 239 /* LabeledStatement */: { + case 238 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -10730,16 +10727,16 @@ var ts; switch (declaration.kind) { case 75 /* Identifier */: return declaration; - case 324 /* JSDocPropertyTag */: - case 318 /* JSDocParameterTag */: { + case 323 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 154 /* QualifiedName */) { + if (name.kind === 153 /* QualifiedName */) { return name.right; } break; } - case 197 /* CallExpression */: - case 210 /* BinaryExpression */: { + case 196 /* CallExpression */: + case 209 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -10755,15 +10752,15 @@ var ts; return undefined; } } - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 317 /* JSDocEnumTag */: + case 316 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { var expression = declaration.expression; return isIdentifier(expression) ? expression : undefined; } - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -10999,7 +10996,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 304 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 303 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -11070,11 +11067,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 154 /* QualifiedName */; + return node.kind === 153 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 155 /* ComputedPropertyName */; + return node.kind === 154 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -11087,164 +11084,164 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 156 /* TypeParameter */; + return node.kind === 155 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 157 /* Parameter */; + return node.kind === 156 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 158 /* Decorator */; + return node.kind === 157 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 159 /* PropertySignature */; + return node.kind === 158 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 160 /* PropertyDeclaration */; + return node.kind === 159 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 161 /* MethodSignature */; + return node.kind === 160 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 163 /* Constructor */; + return node.kind === 162 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 166 /* CallSignature */; + return node.kind === 165 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 167 /* ConstructSignature */; + return node.kind === 166 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 168 /* IndexSignature */; + return node.kind === 167 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 165 /* SetAccessor */ || node.kind === 164 /* GetAccessor */; + return node.kind === 164 /* SetAccessor */ || node.kind === 163 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 169 /* TypePredicate */; + return node.kind === 168 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 170 /* TypeReference */; + return node.kind === 169 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 171 /* FunctionType */; + return node.kind === 170 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 172 /* ConstructorType */; + return node.kind === 171 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 174 /* TypeLiteral */; + return node.kind === 173 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 175 /* ArrayType */; + return node.kind === 174 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 176 /* TupleType */; + return node.kind === 175 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 179 /* UnionType */; + return node.kind === 178 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 180 /* IntersectionType */; + return node.kind === 179 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 181 /* ConditionalType */; + return node.kind === 180 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 182 /* InferType */; + return node.kind === 181 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 183 /* ParenthesizedType */; + return node.kind === 182 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 184 /* ThisType */; + return node.kind === 183 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 185 /* TypeOperator */; + return node.kind === 184 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 186 /* IndexedAccessType */; + return node.kind === 185 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 187 /* MappedType */; + return node.kind === 186 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 188 /* LiteralType */; + return node.kind === 187 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 189 /* ImportType */; + return node.kind === 188 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 190 /* ObjectBindingPattern */; + return node.kind === 189 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 191 /* ArrayBindingPattern */; + return node.kind === 190 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 192 /* BindingElement */; + return node.kind === 191 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 193 /* ArrayLiteralExpression */; + return node.kind === 192 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 194 /* ObjectLiteralExpression */; + return node.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isPropertyAccessChain(node) { @@ -11252,7 +11249,7 @@ var ts; } ts.isPropertyAccessChain = isPropertyAccessChain; function isElementAccessExpression(node) { - return node.kind === 196 /* ElementAccessExpression */; + return node.kind === 195 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isElementAccessChain(node) { @@ -11260,7 +11257,7 @@ var ts; } ts.isElementAccessChain = isElementAccessChain; function isCallExpression(node) { - return node.kind === 197 /* CallExpression */; + return node.kind === 196 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isCallChain(node) { @@ -11270,14 +11267,15 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 195 /* PropertyAccessExpression */ - || kind === 196 /* ElementAccessExpression */ - || kind === 197 /* CallExpression */); + (kind === 194 /* PropertyAccessExpression */ + || kind === 195 /* ElementAccessExpression */ + || kind === 196 /* CallExpression */ + || kind === 218 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ function isOptionalChainRoot(node) { - return isOptionalChain(node) && !!node.questionDotToken; + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; } ts.isOptionalChainRoot = isOptionalChainRoot; /** @@ -11292,33 +11290,34 @@ var ts; * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`: * * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`) - * 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) - * 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is + * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`) + * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain) + * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is * the end of the chain starting at `c?.`) - * 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is + * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is * the end of the chain starting at `a?.`) */ /* @internal */ function isOutermostOptionalChain(node) { - return !isOptionalChain(node.parent) // cases 1 and 2 - || isOptionalChainRoot(node.parent) // case 3 - || node !== node.parent.expression; // case 4 + return !isOptionalChain(node.parent) // cases 1, 2, and 3 + || isOptionalChainRoot(node.parent) // case 4 + || node !== node.parent.expression; // case 5 } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isNewExpression(node) { - return node.kind === 198 /* NewExpression */; + return node.kind === 197 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 199 /* TaggedTemplateExpression */; + return node.kind === 198 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 200 /* TypeAssertionExpression */; + return node.kind === 199 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -11327,384 +11326,385 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 201 /* ParenthesizedExpression */; + return node.kind === 200 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 327 /* PartiallyEmittedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 202 /* FunctionExpression */; + return node.kind === 201 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 203 /* ArrowFunction */; + return node.kind === 202 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 204 /* DeleteExpression */; + return node.kind === 203 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 205 /* TypeOfExpression */; + return node.kind === 204 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 206 /* VoidExpression */; + return node.kind === 205 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 207 /* AwaitExpression */; + return node.kind === 206 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 208 /* PrefixUnaryExpression */; + return node.kind === 207 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 209 /* PostfixUnaryExpression */; + return node.kind === 208 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 210 /* BinaryExpression */; + return node.kind === 209 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 211 /* ConditionalExpression */; + return node.kind === 210 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 212 /* TemplateExpression */; + return node.kind === 211 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 213 /* YieldExpression */; + return node.kind === 212 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 214 /* SpreadElement */; + return node.kind === 213 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 215 /* ClassExpression */; + return node.kind === 214 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 216 /* OmittedExpression */; + return node.kind === 215 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 218 /* AsExpression */; + return node.kind === 217 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 219 /* NonNullExpression */; + return node.kind === 218 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + } + ts.isNonNullChain = isNonNullChain; function isMetaProperty(node) { - return node.kind === 220 /* MetaProperty */; + return node.kind === 219 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 222 /* TemplateSpan */; + return node.kind === 221 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 223 /* SemicolonClassElement */; + return node.kind === 222 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 224 /* Block */; + return node.kind === 223 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 226 /* VariableStatement */; + return node.kind === 225 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 225 /* EmptyStatement */; + return node.kind === 224 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 227 /* ExpressionStatement */; + return node.kind === 226 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 228 /* IfStatement */; + return node.kind === 227 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 229 /* DoStatement */; + return node.kind === 228 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 230 /* WhileStatement */; + return node.kind === 229 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 231 /* ForStatement */; + return node.kind === 230 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 232 /* ForInStatement */; + return node.kind === 231 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 233 /* ForOfStatement */; + return node.kind === 232 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 234 /* ContinueStatement */; + return node.kind === 233 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 235 /* BreakStatement */; + return node.kind === 234 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 235 /* BreakStatement */ || node.kind === 234 /* ContinueStatement */; + return node.kind === 234 /* BreakStatement */ || node.kind === 233 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 236 /* ReturnStatement */; + return node.kind === 235 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 237 /* WithStatement */; + return node.kind === 236 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 238 /* SwitchStatement */; + return node.kind === 237 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 239 /* LabeledStatement */; + return node.kind === 238 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 240 /* ThrowStatement */; + return node.kind === 239 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 241 /* TryStatement */; + return node.kind === 240 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 242 /* DebuggerStatement */; + return node.kind === 241 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 243 /* VariableDeclaration */; + return node.kind === 242 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 244 /* VariableDeclarationList */; + return node.kind === 243 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 245 /* FunctionDeclaration */; + return node.kind === 244 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 246 /* ClassDeclaration */; + return node.kind === 245 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 247 /* InterfaceDeclaration */; + return node.kind === 246 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 248 /* TypeAliasDeclaration */; + return node.kind === 247 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 249 /* EnumDeclaration */; + return node.kind === 248 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */; + return node.kind === 249 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 251 /* ModuleBlock */; + return node.kind === 250 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 252 /* CaseBlock */; + return node.kind === 251 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 253 /* NamespaceExportDeclaration */; + return node.kind === 252 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */; + return node.kind === 253 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 255 /* ImportDeclaration */; + return node.kind === 254 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 256 /* ImportClause */; + return node.kind === 255 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 257 /* NamespaceImport */; + return node.kind === 256 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 263 /* NamespaceExport */; + return node.kind === 262 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedExportBindings(node) { - return node.kind === 263 /* NamespaceExport */ || node.kind === 262 /* NamedExports */; + return node.kind === 262 /* NamespaceExport */ || node.kind === 261 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isNamedImports(node) { - return node.kind === 258 /* NamedImports */; + return node.kind === 257 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 259 /* ImportSpecifier */; + return node.kind === 258 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 260 /* ExportAssignment */; + return node.kind === 259 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 261 /* ExportDeclaration */; + return node.kind === 260 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 262 /* NamedExports */; + return node.kind === 261 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 264 /* ExportSpecifier */; + return node.kind === 263 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 265 /* MissingDeclaration */; + return node.kind === 264 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 266 /* ExternalModuleReference */; + return node.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 267 /* JsxElement */; + return node.kind === 266 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 268 /* JsxSelfClosingElement */; + return node.kind === 267 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 269 /* JsxOpeningElement */; + return node.kind === 268 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 270 /* JsxClosingElement */; + return node.kind === 269 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 271 /* JsxFragment */; + return node.kind === 270 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 272 /* JsxOpeningFragment */; + return node.kind === 271 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 273 /* JsxClosingFragment */; + return node.kind === 272 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 274 /* JsxAttribute */; + return node.kind === 273 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 275 /* JsxAttributes */; + return node.kind === 274 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 276 /* JsxSpreadAttribute */; + return node.kind === 275 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 277 /* JsxExpression */; + return node.kind === 276 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 278 /* CaseClause */; + return node.kind === 277 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 279 /* DefaultClause */; + return node.kind === 278 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 280 /* HeritageClause */; + return node.kind === 279 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 281 /* CatchClause */; + return node.kind === 280 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 282 /* PropertyAssignment */; + return node.kind === 281 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */; + return node.kind === 282 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 284 /* SpreadAssignment */; + return node.kind === 283 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 291 /* SourceFile */; + return node.kind === 290 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 292 /* Bundle */; + return node.kind === 291 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 293 /* UnparsedSource */; + return node.kind === 292 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 287 /* UnparsedPrepend */; + return node.kind === 286 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return true; default: return false; @@ -11713,125 +11713,125 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 286 /* UnparsedPrologue */ || - node.kind === 290 /* UnparsedSyntheticReference */; + node.kind === 285 /* UnparsedPrologue */ || + node.kind === 289 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 295 /* JSDocTypeExpression */; + return node.kind === 294 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 296 /* JSDocAllType */; + return node.kind === 295 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 297 /* JSDocUnknownType */; + return node.kind === 296 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 298 /* JSDocNullableType */; + return node.kind === 297 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 299 /* JSDocNonNullableType */; + return node.kind === 298 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 300 /* JSDocOptionalType */; + return node.kind === 299 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 301 /* JSDocFunctionType */; + return node.kind === 300 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 302 /* JSDocVariadicType */; + return node.kind === 301 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 304 /* JSDocComment */; + return node.kind === 303 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAuthorTag(node) { - return node.kind === 310 /* JSDocAuthorTag */; + return node.kind === 309 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocAugmentsTag(node) { - return node.kind === 308 /* JSDocAugmentsTag */; + return node.kind === 307 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocImplementsTag(node) { - return node.kind === 309 /* JSDocImplementsTag */; + return node.kind === 308 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isJSDocClassTag(node) { - return node.kind === 311 /* JSDocClassTag */; + return node.kind === 310 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocPublicTag(node) { - return node.kind === 312 /* JSDocPublicTag */; + return node.kind === 311 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 313 /* JSDocPrivateTag */; + return node.kind === 312 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 314 /* JSDocProtectedTag */; + return node.kind === 313 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 315 /* JSDocReadonlyTag */; + return node.kind === 314 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocEnumTag(node) { - return node.kind === 317 /* JSDocEnumTag */; + return node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 320 /* JSDocThisTag */; + return node.kind === 319 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 318 /* JSDocParameterTag */; + return node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 319 /* JSDocReturnTag */; + return node.kind === 318 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 321 /* JSDocTypeTag */; + return node.kind === 320 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 322 /* JSDocTemplateTag */; + return node.kind === 321 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 323 /* JSDocTypedefTag */; + return node.kind === 322 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 324 /* JSDocPropertyTag */; + return node.kind === 323 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 324 /* JSDocPropertyTag */ || node.kind === 318 /* JSDocParameterTag */; + return node.kind === 323 /* JSDocPropertyTag */ || node.kind === 317 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 305 /* JSDocTypeLiteral */; + return node.kind === 304 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 316 /* JSDocCallbackTag */; + return node.kind === 315 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 306 /* JSDocSignature */; + return node.kind === 305 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // #endregion @@ -11842,7 +11842,7 @@ var ts; // they may be used with transformations. /* @internal */ function isSyntaxList(n) { - return n.kind === 325 /* SyntaxList */; + return n.kind === 324 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -11852,7 +11852,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 154 /* FirstNode */; + return kind >= 153 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -11861,7 +11861,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 153 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 152 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -11902,12 +11902,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.isTypeOnly; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -11942,13 +11942,13 @@ var ts; case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 84 /* DefaultKeyword */: case 89 /* ExportKeyword */: case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: case 120 /* StaticKeyword */: return true; } @@ -11971,7 +11971,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 154 /* QualifiedName */ + return kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isEntityName = isEntityName; @@ -11981,14 +11981,14 @@ var ts; || kind === 76 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 155 /* ComputedPropertyName */; + || kind === 154 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 190 /* ObjectBindingPattern */ - || kind === 191 /* ArrayBindingPattern */; + || kind === 189 /* ObjectBindingPattern */ + || kind === 190 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12003,13 +12003,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: return false; @@ -12018,14 +12018,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 172 /* ConstructorType */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 171 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12040,29 +12040,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 160 /* PropertyDeclaration */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 168 /* IndexSignature */ - || kind === 223 /* SemicolonClassElement */; + return kind === 162 /* Constructor */ + || kind === 159 /* PropertyDeclaration */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 167 /* IndexSignature */ + || kind === 222 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */); + return node && (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */); + return node && (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; default: return false; @@ -12072,11 +12072,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 167 /* ConstructSignature */ - || kind === 166 /* CallSignature */ - || kind === 159 /* PropertySignature */ - || kind === 161 /* MethodSignature */ - || kind === 168 /* IndexSignature */; + return kind === 166 /* ConstructSignature */ + || kind === 165 /* CallSignature */ + || kind === 158 /* PropertySignature */ + || kind === 160 /* MethodSignature */ + || kind === 167 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12085,12 +12085,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 282 /* PropertyAssignment */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 284 /* SpreadAssignment */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 281 /* PropertyAssignment */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 283 /* SpreadAssignment */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12105,8 +12105,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return true; } return false; @@ -12117,8 +12117,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 191 /* ArrayBindingPattern */ - || kind === 190 /* ObjectBindingPattern */; + return kind === 190 /* ArrayBindingPattern */ + || kind === 189 /* ObjectBindingPattern */; } return false; } @@ -12126,15 +12126,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 193 /* ArrayLiteralExpression */ - || kind === 194 /* ObjectLiteralExpression */; + return kind === 192 /* ArrayLiteralExpression */ + || kind === 193 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 192 /* BindingElement */ - || kind === 216 /* OmittedExpression */; + return kind === 191 /* BindingElement */ + || kind === 215 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12143,9 +12143,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: return true; } return false; @@ -12166,8 +12166,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return true; } return false; @@ -12179,8 +12179,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return true; } return false; @@ -12189,26 +12189,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */ - || kind === 189 /* ImportType */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */ + || kind === 188 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 195 /* PropertyAccessExpression */ - || kind === 154 /* QualifiedName */; + return kind === 194 /* PropertyAccessExpression */ + || kind === 153 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: return true; default: return false; @@ -12216,12 +12216,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 197 /* CallExpression */ || node.kind === 198 /* NewExpression */; + return node.kind === 196 /* CallExpression */ || node.kind === 197 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 212 /* TemplateExpression */ + return kind === 211 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12232,33 +12232,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 198 /* NewExpression */: - case 197 /* CallExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 199 /* TaggedTemplateExpression */: - case 193 /* ArrayLiteralExpression */: - case 201 /* ParenthesizedExpression */: - case 194 /* ObjectLiteralExpression */: - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 197 /* NewExpression */: + case 196 /* CallExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 198 /* TaggedTemplateExpression */: + case 192 /* ArrayLiteralExpression */: + case 200 /* ParenthesizedExpression */: + case 193 /* ObjectLiteralExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: case 75 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 106 /* TrueKeyword */: case 102 /* SuperKeyword */: - case 219 /* NonNullExpression */: - case 220 /* MetaProperty */: + case 218 /* NonNullExpression */: + case 219 /* MetaProperty */: case 96 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12272,13 +12272,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 200 /* TypeAssertionExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 199 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12287,9 +12287,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12308,15 +12308,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: - case 203 /* ArrowFunction */: - case 210 /* BinaryExpression */: - case 214 /* SpreadElement */: - case 218 /* AsExpression */: - case 216 /* OmittedExpression */: - case 328 /* CommaListExpression */: - case 327 /* PartiallyEmittedExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: + case 202 /* ArrowFunction */: + case 209 /* BinaryExpression */: + case 213 /* SpreadElement */: + case 217 /* AsExpression */: + case 215 /* OmittedExpression */: + case 327 /* CommaListExpression */: + case 326 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12324,23 +12324,23 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 200 /* TypeAssertionExpression */ - || kind === 218 /* AsExpression */; + return kind === 199 /* TypeAssertionExpression */ + || kind === 217 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 327 /* PartiallyEmittedExpression */; + return node.kind === 326 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 326 /* NotEmittedStatement */; + return node.kind === 325 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 331 /* SyntheticReferenceExpression */; + return node.kind === 330 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ @@ -12351,13 +12351,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return true; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12386,7 +12386,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 232 /* ForInStatement */ || node.kind === 233 /* ForOfStatement */; + return node.kind === 231 /* ForInStatement */ || node.kind === 232 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12410,114 +12410,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */ + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */ || kind === 75 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 251 /* ModuleBlock */ - || kind === 250 /* ModuleDeclaration */; + return kind === 250 /* ModuleBlock */ + || kind === 249 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 75 /* Identifier */ - || kind === 250 /* ModuleDeclaration */; + || kind === 249 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 258 /* NamedImports */ - || kind === 257 /* NamespaceImport */; + return kind === 257 /* NamedImports */ + || kind === 256 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 250 /* ModuleDeclaration */ || node.kind === 249 /* EnumDeclaration */; + return node.kind === 249 /* ModuleDeclaration */ || node.kind === 248 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 203 /* ArrowFunction */ - || kind === 192 /* BindingElement */ - || kind === 246 /* ClassDeclaration */ - || kind === 215 /* ClassExpression */ - || kind === 163 /* Constructor */ - || kind === 249 /* EnumDeclaration */ - || kind === 285 /* EnumMember */ - || kind === 264 /* ExportSpecifier */ - || kind === 245 /* FunctionDeclaration */ - || kind === 202 /* FunctionExpression */ - || kind === 164 /* GetAccessor */ - || kind === 256 /* ImportClause */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 259 /* ImportSpecifier */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 274 /* JsxAttribute */ - || kind === 162 /* MethodDeclaration */ - || kind === 161 /* MethodSignature */ - || kind === 250 /* ModuleDeclaration */ - || kind === 253 /* NamespaceExportDeclaration */ - || kind === 257 /* NamespaceImport */ - || kind === 263 /* NamespaceExport */ - || kind === 157 /* Parameter */ - || kind === 282 /* PropertyAssignment */ - || kind === 160 /* PropertyDeclaration */ - || kind === 159 /* PropertySignature */ - || kind === 165 /* SetAccessor */ - || kind === 283 /* ShorthandPropertyAssignment */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 156 /* TypeParameter */ - || kind === 243 /* VariableDeclaration */ - || kind === 323 /* JSDocTypedefTag */ - || kind === 316 /* JSDocCallbackTag */ - || kind === 324 /* JSDocPropertyTag */; + return kind === 202 /* ArrowFunction */ + || kind === 191 /* BindingElement */ + || kind === 245 /* ClassDeclaration */ + || kind === 214 /* ClassExpression */ + || kind === 162 /* Constructor */ + || kind === 248 /* EnumDeclaration */ + || kind === 284 /* EnumMember */ + || kind === 263 /* ExportSpecifier */ + || kind === 244 /* FunctionDeclaration */ + || kind === 201 /* FunctionExpression */ + || kind === 163 /* GetAccessor */ + || kind === 255 /* ImportClause */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportSpecifier */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 273 /* JsxAttribute */ + || kind === 161 /* MethodDeclaration */ + || kind === 160 /* MethodSignature */ + || kind === 249 /* ModuleDeclaration */ + || kind === 252 /* NamespaceExportDeclaration */ + || kind === 256 /* NamespaceImport */ + || kind === 262 /* NamespaceExport */ + || kind === 156 /* Parameter */ + || kind === 281 /* PropertyAssignment */ + || kind === 159 /* PropertyDeclaration */ + || kind === 158 /* PropertySignature */ + || kind === 164 /* SetAccessor */ + || kind === 282 /* ShorthandPropertyAssignment */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 155 /* TypeParameter */ + || kind === 242 /* VariableDeclaration */ + || kind === 322 /* JSDocTypedefTag */ + || kind === 315 /* JSDocCallbackTag */ + || kind === 323 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 245 /* FunctionDeclaration */ - || kind === 265 /* MissingDeclaration */ - || kind === 246 /* ClassDeclaration */ - || kind === 247 /* InterfaceDeclaration */ - || kind === 248 /* TypeAliasDeclaration */ - || kind === 249 /* EnumDeclaration */ - || kind === 250 /* ModuleDeclaration */ - || kind === 255 /* ImportDeclaration */ - || kind === 254 /* ImportEqualsDeclaration */ - || kind === 261 /* ExportDeclaration */ - || kind === 260 /* ExportAssignment */ - || kind === 253 /* NamespaceExportDeclaration */; + return kind === 244 /* FunctionDeclaration */ + || kind === 264 /* MissingDeclaration */ + || kind === 245 /* ClassDeclaration */ + || kind === 246 /* InterfaceDeclaration */ + || kind === 247 /* TypeAliasDeclaration */ + || kind === 248 /* EnumDeclaration */ + || kind === 249 /* ModuleDeclaration */ + || kind === 254 /* ImportDeclaration */ + || kind === 253 /* ImportEqualsDeclaration */ + || kind === 260 /* ExportDeclaration */ + || kind === 259 /* ExportAssignment */ + || kind === 252 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 235 /* BreakStatement */ - || kind === 234 /* ContinueStatement */ - || kind === 242 /* DebuggerStatement */ - || kind === 229 /* DoStatement */ - || kind === 227 /* ExpressionStatement */ - || kind === 225 /* EmptyStatement */ - || kind === 232 /* ForInStatement */ - || kind === 233 /* ForOfStatement */ - || kind === 231 /* ForStatement */ - || kind === 228 /* IfStatement */ - || kind === 239 /* LabeledStatement */ - || kind === 236 /* ReturnStatement */ - || kind === 238 /* SwitchStatement */ - || kind === 240 /* ThrowStatement */ - || kind === 241 /* TryStatement */ - || kind === 226 /* VariableStatement */ - || kind === 230 /* WhileStatement */ - || kind === 237 /* WithStatement */ - || kind === 326 /* NotEmittedStatement */ - || kind === 330 /* EndOfDeclarationMarker */ - || kind === 329 /* MergeDeclarationMarker */; + return kind === 234 /* BreakStatement */ + || kind === 233 /* ContinueStatement */ + || kind === 241 /* DebuggerStatement */ + || kind === 228 /* DoStatement */ + || kind === 226 /* ExpressionStatement */ + || kind === 224 /* EmptyStatement */ + || kind === 231 /* ForInStatement */ + || kind === 232 /* ForOfStatement */ + || kind === 230 /* ForStatement */ + || kind === 227 /* IfStatement */ + || kind === 238 /* LabeledStatement */ + || kind === 235 /* ReturnStatement */ + || kind === 237 /* SwitchStatement */ + || kind === 239 /* ThrowStatement */ + || kind === 240 /* TryStatement */ + || kind === 225 /* VariableStatement */ + || kind === 229 /* WhileStatement */ + || kind === 236 /* WithStatement */ + || kind === 325 /* NotEmittedStatement */ + || kind === 329 /* EndOfDeclarationMarker */ + || kind === 328 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 156 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 322 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 155 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 321 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12544,10 +12544,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 224 /* Block */) + if (node.kind !== 223 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 241 /* TryStatement */ || node.parent.kind === 281 /* CatchClause */) { + if (node.parent.kind === 240 /* TryStatement */ || node.parent.kind === 280 /* CatchClause */) { return false; } } @@ -12557,8 +12557,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 266 /* ExternalModuleReference */ - || kind === 154 /* QualifiedName */ + return kind === 265 /* ExternalModuleReference */ + || kind === 153 /* QualifiedName */ || kind === 75 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12568,70 +12568,70 @@ var ts; var kind = node.kind; return kind === 104 /* ThisKeyword */ || kind === 75 /* Identifier */ - || kind === 195 /* PropertyAccessExpression */; + || kind === 194 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 267 /* JsxElement */ - || kind === 277 /* JsxExpression */ - || kind === 268 /* JsxSelfClosingElement */ + return kind === 266 /* JsxElement */ + || kind === 276 /* JsxExpression */ + || kind === 267 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 271 /* JsxFragment */; + || kind === 270 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 274 /* JsxAttribute */ - || kind === 276 /* JsxSpreadAttribute */; + return kind === 273 /* JsxAttribute */ + || kind === 275 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 277 /* JsxExpression */; + || kind === 276 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 269 /* JsxOpeningElement */ - || kind === 268 /* JsxSelfClosingElement */; + return kind === 268 /* JsxOpeningElement */ + || kind === 267 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 278 /* CaseClause */ - || kind === 279 /* DefaultClause */; + return kind === 277 /* CaseClause */ + || kind === 278 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 295 /* FirstJSDocNode */ && node.kind <= 324 /* LastJSDocNode */; + return node.kind >= 294 /* FirstJSDocNode */ && node.kind <= 323 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 304 /* JSDocComment */ || node.kind === 303 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 303 /* JSDocComment */ || node.kind === 302 /* JSDocNamepathType */ || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 307 /* FirstJSDocTagNode */ && node.kind <= 324 /* LastJSDocTagNode */; + return node.kind >= 306 /* FirstJSDocTagNode */ && node.kind <= 323 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 165 /* SetAccessor */; + return node.kind === 164 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 164 /* GetAccessor */; + return node.kind === 163 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -12657,13 +12657,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 159 /* PropertySignature */: - case 160 /* PropertyDeclaration */: - case 282 /* PropertyAssignment */: - case 285 /* EnumMember */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 158 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 281 /* PropertyAssignment */: + case 284 /* EnumMember */: return true; default: return false; @@ -12671,12 +12671,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 274 /* JsxAttribute */ || node.kind === 276 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 273 /* JsxAttribute */ || node.kind === 275 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 170 /* TypeReference */ || node.kind === 217 /* ExpressionWithTypeArguments */; + return node.kind === 169 /* TypeReference */ || node.kind === 216 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -12971,7 +12971,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 291 /* SourceFile */) { + while (node && node.kind !== 290 /* SourceFile */) { node = node.parent; } return node; @@ -12979,11 +12979,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return true; } return false; @@ -13178,7 +13178,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 325 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 324 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13303,7 +13303,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 243 /* VariableDeclaration */ && node.parent.kind === 281 /* CatchClause */; + return node.kind === 242 /* VariableDeclaration */ && node.parent.kind === 280 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13335,11 +13335,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 && node.kind === 250 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 249 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 291 /* SourceFile */ || - node.kind === 250 /* ModuleDeclaration */ || + return node.kind === 290 /* SourceFile */ || + node.kind === 249 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13356,9 +13356,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.isExternalModule(node.parent); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13411,22 +13411,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 281 /* CatchClause */: - case 250 /* ModuleDeclaration */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 280 /* CatchClause */: + case 249 /* ModuleDeclaration */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 224 /* Block */: + case 223 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13436,9 +13436,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 306 /* JSDocSignature */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 305 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13448,25 +13448,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13476,8 +13476,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13486,15 +13486,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 226 /* VariableStatement */: - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 225 /* VariableStatement */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return true; default: return false; @@ -13531,7 +13531,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13547,9 +13547,9 @@ var ts; case 76 /* PrivateIdentifier */: case 75 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -13610,7 +13610,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 224 /* Block */) { + if (node.body && node.body.kind === 223 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -13624,7 +13624,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -13633,28 +13633,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 248 /* TypeAliasDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 247 /* TypeAliasDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: errorNode = node.name; break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -13706,11 +13706,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 102 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 197 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; + return n.kind === 196 /* CallExpression */ && n.expression.kind === 96 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -13724,7 +13724,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 227 /* ExpressionStatement */ + return node.kind === 226 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -13733,11 +13733,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 157 /* Parameter */ || - node.kind === 156 /* TypeParameter */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 203 /* ArrowFunction */ || - node.kind === 201 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 156 /* Parameter */ || + node.kind === 155 /* TypeParameter */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 202 /* ArrowFunction */ || + node.kind === 200 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -13753,48 +13753,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (169 /* FirstTypeNode */ <= node.kind && node.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= node.kind && node.kind <= 188 /* LastTypeNode */) { return true; } switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: return true; case 110 /* VoidKeyword */: - return node.parent.kind !== 206 /* VoidExpression */; - case 217 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 205 /* VoidExpression */; + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 156 /* TypeParameter */: - return node.parent.kind === 187 /* MappedType */ || node.parent.kind === 182 /* InferType */; + case 155 /* TypeParameter */: + return node.parent.kind === 186 /* MappedType */ || node.parent.kind === 181 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 75 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 194 /* 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 === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */ || node.kind === 195 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */ || node.kind === 194 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 154 /* QualifiedName */: - case 195 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: case 104 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 173 /* TypeQuery */) { + if (parent.kind === 172 /* TypeQuery */) { return false; } - if (parent.kind === 189 /* ImportType */) { + if (parent.kind === 188 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -13803,40 +13803,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (169 /* FirstTypeNode */ <= parent.kind && parent.kind <= 189 /* LastTypeNode */) { + if (168 /* FirstTypeNode */ <= parent.kind && parent.kind <= 188 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return node === parent.constraint; - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return node === parent.constraint; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return node === parent.type; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node === parent.type; - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return node === parent.type; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return node === parent.type; - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -13861,23 +13861,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitor(node); - case 252 /* CaseBlock */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 251 /* CaseBlock */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -13887,23 +13887,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 249 /* EnumDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* 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(node.name.expression); @@ -13926,10 +13926,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 175 /* ArrayType */) { + if (node && node.kind === 174 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 170 /* TypeReference */) { + else if (node && node.kind === 169 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -13939,12 +13939,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 174 /* TypeLiteral */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 173 /* TypeLiteral */: return node.members; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return node.properties; } } @@ -13952,14 +13952,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 192 /* BindingElement */: - case 285 /* EnumMember */: - case 157 /* Parameter */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 283 /* ShorthandPropertyAssignment */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 284 /* EnumMember */: + case 156 /* Parameter */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 282 /* ShorthandPropertyAssignment */: + case 242 /* VariableDeclaration */: return true; } } @@ -13971,8 +13971,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 244 /* VariableDeclarationList */ - && node.parent.parent.kind === 226 /* VariableStatement */; + return node.parent.kind === 243 /* VariableDeclarationList */ + && node.parent.parent.kind === 225 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -13983,13 +13983,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return true; } return false; @@ -14000,7 +14000,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 239 /* LabeledStatement */) { + if (node.statement.kind !== 238 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14008,17 +14008,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 224 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 223 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 162 /* MethodDeclaration */ && node.parent.kind === 194 /* ObjectLiteralExpression */; + return node && node.kind === 161 /* MethodDeclaration */ && node.parent.kind === 193 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 162 /* MethodDeclaration */ && - (node.parent.kind === 194 /* ObjectLiteralExpression */ || - node.parent.kind === 215 /* ClassExpression */); + return node.kind === 161 /* MethodDeclaration */ && + (node.parent.kind === 193 /* ObjectLiteralExpression */ || + node.parent.kind === 214 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14031,7 +14031,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 282 /* PropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14072,14 +14072,14 @@ var ts; } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 291 /* SourceFile */); + ts.Debug.assert(node.kind !== 290 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* 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 @@ -14094,9 +14094,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14107,26 +14107,26 @@ var ts; node = node.parent; } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 250 /* ModuleDeclaration */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 249 /* EnumDeclaration */: - case 291 /* SourceFile */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 249 /* ModuleDeclaration */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 248 /* EnumDeclaration */: + case 290 /* SourceFile */: return node; } } @@ -14136,9 +14136,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: return container; } } @@ -14160,27 +14160,27 @@ var ts; return node; } switch (node.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: node = node.parent; break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return node; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 157 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 156 /* Parameter */ && ts.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; @@ -14196,14 +14196,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 202 /* FunctionExpression */ || func.kind === 203 /* ArrowFunction */) { + if (func.kind === 201 /* FunctionExpression */ || func.kind === 202 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 201 /* ParenthesizedExpression */) { + while (parent.kind === 200 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 197 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 196 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14219,7 +14219,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 102 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14228,20 +14228,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 195 /* PropertyAccessExpression */ || kind === 196 /* ElementAccessExpression */) + return (kind === 194 /* PropertyAccessExpression */ || kind === 195 /* ElementAccessExpression */) && node.expression.kind === 104 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return node; } return undefined; @@ -14249,10 +14249,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return node.tag; - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14265,25 +14265,25 @@ var ts; return false; } switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // classes are valid targets return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 246 /* ClassDeclaration */; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + return parent.kind === 245 /* ClassDeclaration */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 246 /* ClassDeclaration */; - case 157 /* Parameter */: + && parent.kind === 245 /* ClassDeclaration */; + case 156 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 163 /* Constructor */ - || parent.kind === 162 /* MethodDeclaration */ - || parent.kind === 165 /* SetAccessor */) - && grandparent.kind === 246 /* ClassDeclaration */; + && (parent.kind === 162 /* Constructor */ + || parent.kind === 161 /* MethodDeclaration */ + || parent.kind === 164 /* SetAccessor */) + && grandparent.kind === 245 /* ClassDeclaration */; } return false; } @@ -14299,10 +14299,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14311,9 +14311,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 269 /* JsxOpeningElement */ || - parent.kind === 268 /* JsxSelfClosingElement */ || - parent.kind === 270 /* JsxClosingElement */) { + if (parent.kind === 268 /* JsxOpeningElement */ || + parent.kind === 267 /* JsxSelfClosingElement */ || + parent.kind === 269 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14326,44 +14326,44 @@ var ts; case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 218 /* AsExpression */: - case 200 /* TypeAssertionExpression */: - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: - case 210 /* BinaryExpression */: - case 211 /* ConditionalExpression */: - case 214 /* SpreadElement */: - case 212 /* TemplateExpression */: - case 216 /* OmittedExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: - case 213 /* YieldExpression */: - case 207 /* AwaitExpression */: - case 220 /* MetaProperty */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 217 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 209 /* BinaryExpression */: + case 210 /* ConditionalExpression */: + case 213 /* SpreadElement */: + case 211 /* TemplateExpression */: + case 215 /* OmittedExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: + case 212 /* YieldExpression */: + case 206 /* AwaitExpression */: + case 219 /* MetaProperty */: return true; - case 154 /* QualifiedName */: - while (node.parent.kind === 154 /* QualifiedName */) { + case 153 /* QualifiedName */: + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node); case 75 /* Identifier */: - if (node.parent.kind === 173 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 172 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14381,49 +14381,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 191 /* BindingElement */: return parent.initializer === node; - case 227 /* ExpressionStatement */: - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 236 /* ReturnStatement */: - case 237 /* WithStatement */: - case 238 /* SwitchStatement */: - case 278 /* CaseClause */: - case 240 /* ThrowStatement */: + case 226 /* ExpressionStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 235 /* ReturnStatement */: + case 236 /* WithStatement */: + case 237 /* SwitchStatement */: + case 277 /* CaseClause */: + case 239 /* ThrowStatement */: return parent.expression === node; - case 231 /* ForStatement */: + case 230 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 244 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */) || forInStatement.expression === node; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return node === parent.expression; - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return node === parent.expression; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return node === parent.expression; - case 158 /* Decorator */: - case 277 /* JsxExpression */: - case 276 /* JsxSpreadAttribute */: - case 284 /* SpreadAssignment */: + case 157 /* Decorator */: + case 276 /* JsxExpression */: + case 275 /* JsxSpreadAttribute */: + case 283 /* SpreadAssignment */: return true; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14431,14 +14431,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 154 /* QualifiedName */ || node.kind === 75 /* Identifier */) { + while (node.kind === 153 /* QualifiedName */ || node.kind === 75 /* Identifier */) { node = node.parent; } - return node.kind === 173 /* TypeQuery */; + return node.kind === 172 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14447,7 +14447,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 266 /* ExternalModuleReference */; + return node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 265 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14479,11 +14479,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 144 /* StringKeyword */ || node.typeArguments[0].kind === 141 /* NumberKeyword */); + (node.typeArguments[0].kind === 143 /* StringKeyword */ || node.typeArguments[0].kind === 140 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 197 /* CallExpression */) { + if (callExpression.kind !== 196 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14615,11 +14615,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 202 /* FunctionExpression */ || e.kind === 203 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 201 /* FunctionExpression */ || e.kind === 202 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 202 /* FunctionExpression */ || - initializer.kind === 215 /* ClassExpression */ || - initializer.kind === 203 /* ArrowFunction */) { + if (initializer.kind === 201 /* FunctionExpression */ || + initializer.kind === 214 /* ClassExpression */ || + initializer.kind === 202 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -14866,7 +14866,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 227 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 226 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -14876,7 +14876,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 245 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 244 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -14885,14 +14885,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.parent; - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return node.parent.parent; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 188 /* LiteralType */: + case 187 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -14902,12 +14902,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return node.moduleSpecifier; - case 254 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 266 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 189 /* ImportType */: + case 253 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 265 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 188 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -14916,11 +14916,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -14928,7 +14928,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 255 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 254 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -14949,13 +14949,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 157 /* Parameter */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 283 /* ShorthandPropertyAssignment */: - case 282 /* PropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 156 /* Parameter */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 282 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -14969,7 +14969,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 323 /* JSDocTypedefTag */ || node.kind === 316 /* JSDocCallbackTag */ || node.kind === 317 /* JSDocEnumTag */; + return node.kind === 322 /* JSDocTypedefTag */ || node.kind === 315 /* JSDocCallbackTag */ || node.kind === 316 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -14994,12 +14994,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return node.initializer; } } @@ -15010,7 +15010,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 250 /* ModuleDeclaration */ + node.body.kind === 249 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15025,11 +15025,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 156 /* TypeParameter */) { + if (node.kind === 155 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -15040,10 +15040,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 282 /* PropertyAssignment */ || - parent.kind === 260 /* ExportAssignment */ || - parent.kind === 160 /* PropertyDeclaration */ || - parent.kind === 227 /* ExpressionStatement */ && node.kind === 195 /* PropertyAccessExpression */ || + if (parent.kind === 281 /* PropertyAssignment */ || + parent.kind === 259 /* ExportAssignment */ || + parent.kind === 159 /* PropertyDeclaration */ || + parent.kind === 226 /* ExpressionStatement */ && node.kind === 194 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15117,7 +15117,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 302 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 301 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15134,31 +15134,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 201 /* ParenthesizedExpression */: - case 193 /* ArrayLiteralExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 192 /* ArrayLiteralExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: node = parent; break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15185,22 +15185,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 224 /* Block */: - case 226 /* VariableStatement */: - case 237 /* WithStatement */: - case 228 /* IfStatement */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 239 /* LabeledStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 241 /* TryStatement */: - case 281 /* CatchClause */: + case 223 /* Block */: + case 225 /* VariableStatement */: + case 236 /* WithStatement */: + case 227 /* IfStatement */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 238 /* LabeledStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 240 /* TryStatement */: + case 280 /* CatchClause */: return true; } return false; @@ -15217,33 +15217,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 183 /* ParenthesizedType */); + return walkUp(node, 182 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 201 /* ParenthesizedExpression */); + return walkUp(node, 200 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; + return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 201 /* ParenthesizedExpression */) { + while (node.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 195 /* PropertyAccessExpression */ && node.kind !== 196 /* ElementAccessExpression */) { + if (node.kind !== 194 /* PropertyAccessExpression */ && node.kind !== 195 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 204 /* DeleteExpression */; + return node && node.kind === 203 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15296,7 +15293,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 155 /* ComputedPropertyName */ && + node.parent.kind === 154 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15304,32 +15301,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 285 /* EnumMember */: - case 282 /* PropertyAssignment */: - case 195 /* PropertyAccessExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 284 /* EnumMember */: + case 281 /* PropertyAssignment */: + case 194 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 154 /* QualifiedName */) { + while (parent.kind === 153 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 173 /* TypeQuery */ || parent.kind === 170 /* TypeReference */; + return parent.kind === 172 /* TypeQuery */ || parent.kind === 169 /* TypeReference */; } return false; - case 192 /* BindingElement */: - case 259 /* ImportSpecifier */: + case 191 /* BindingElement */: + case 258 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 264 /* ExportSpecifier */: - case 274 /* JsxAttribute */: + case 263 /* ExportSpecifier */: + case 273 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15349,33 +15346,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 256 /* ImportClause */: - case 259 /* ImportSpecifier */: - case 257 /* NamespaceImport */: - case 264 /* ExportSpecifier */: - case 260 /* ExportAssignment */: - case 254 /* ImportEqualsDeclaration */: + case 255 /* ImportClause */: + case 258 /* ImportSpecifier */: + case 256 /* NamespaceImport */: + case 263 /* ExportSpecifier */: + case 259 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: return node.parent; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 154 /* QualifiedName */); + } while (node.parent.kind === 153 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15394,7 +15391,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 283 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 282 /* PropertyAssignment */ ? node.initializer : + return node.kind === 282 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 281 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15460,11 +15457,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 77 /* FirstKeyword */ <= token && token <= 153 /* LastKeyword */; + return 77 /* FirstKeyword */ <= token && token <= 152 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 122 /* FirstContextualKeyword */ <= token && token <= 153 /* LastContextualKeyword */; + return 122 /* FirstContextualKeyword */ <= token && token <= 152 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15508,14 +15505,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 161 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -15529,10 +15526,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -15565,7 +15562,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 155 /* ComputedPropertyName */ || name.kind === 196 /* ElementAccessExpression */)) { + if (!(name.kind === 154 /* ComputedPropertyName */ || name.kind === 195 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression; @@ -15591,7 +15588,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -15654,11 +15651,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 157 /* Parameter */; + return root.kind === 156 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 192 /* BindingElement */) { + while (node.kind === 191 /* BindingElement */) { node = node.parent.parent; } return node; @@ -15666,15 +15663,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 163 /* Constructor */ - || kind === 202 /* FunctionExpression */ - || kind === 245 /* FunctionDeclaration */ - || kind === 203 /* ArrowFunction */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 250 /* ModuleDeclaration */ - || kind === 291 /* SourceFile */; + return kind === 162 /* Constructor */ + || kind === 201 /* FunctionExpression */ + || kind === 244 /* FunctionDeclaration */ + || kind === 202 /* ArrowFunction */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 249 /* ModuleDeclaration */ + || kind === 290 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -15693,23 +15690,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: - case 211 /* ConditionalExpression */: - case 213 /* YieldExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: + case 210 /* ConditionalExpression */: + case 212 /* YieldExpression */: return 1 /* Right */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -15733,15 +15730,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 198 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 197 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 210 /* BinaryExpression */) { + if (expression.kind === 209 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 208 /* PrefixUnaryExpression */ || expression.kind === 209 /* PostfixUnaryExpression */) { + else if (expression.kind === 207 /* PrefixUnaryExpression */ || expression.kind === 208 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -15751,15 +15748,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return 0; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return 1; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return 2; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return 4; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; @@ -15780,21 +15777,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 208 /* PrefixUnaryExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 204 /* DeleteExpression */: - case 207 /* AwaitExpression */: + case 207 /* PrefixUnaryExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 203 /* DeleteExpression */: + case 206 /* AwaitExpression */: return 16; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return 17; - case 197 /* CallExpression */: + case 196 /* CallExpression */: return 18; - case 198 /* NewExpression */: + case 197 /* NewExpression */: return hasArguments ? 19 : 18; - case 199 /* TaggedTemplateExpression */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 198 /* TaggedTemplateExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 19; case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: @@ -15805,19 +15802,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 215 /* ClassExpression */: - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 212 /* TemplateExpression */: - case 201 /* ParenthesizedExpression */: - case 216 /* OmittedExpression */: + case 211 /* TemplateExpression */: + case 200 /* ParenthesizedExpression */: + case 215 /* OmittedExpression */: return 20; default: return -1; @@ -16428,10 +16425,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 165 /* SetAccessor */) { + else if (accessor.kind === 164 /* SetAccessor */) { setAccessor = accessor; } else { @@ -16451,10 +16448,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 164 /* GetAccessor */ && !getAccessor) { + if (member.kind === 163 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 165 /* SetAccessor */ && !setAccessor) { + if (member.kind === 164 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -16503,7 +16500,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 304 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 303 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -16727,7 +16724,7 @@ var ts; } ts.getSelectedModifierFlags = getSelectedModifierFlags; function getModifierFlags(node) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 153 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 152 /* LastToken */) { return 0 /* None */; } if (node.modifierFlagsCache & 536870912 /* HasComputedFlags */) { @@ -16769,11 +16766,11 @@ var ts; case 117 /* PrivateKeyword */: return 8 /* Private */; case 122 /* AbstractKeyword */: return 128 /* Abstract */; case 89 /* ExportKeyword */: return 1 /* Export */; - case 131 /* DeclareKeyword */: return 2 /* Ambient */; + case 130 /* DeclareKeyword */: return 2 /* Ambient */; case 81 /* ConstKeyword */: return 2048 /* Const */; case 84 /* DefaultKeyword */: return 512 /* Default */; case 126 /* AsyncKeyword */: return 256 /* Async */; - case 139 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 138 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -16813,8 +16810,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 194 /* ObjectLiteralExpression */ - || kind === 193 /* ArrayLiteralExpression */; + return kind === 193 /* ObjectLiteralExpression */ + || kind === 192 /* ArrayLiteralExpression */; } return false; } @@ -16831,12 +16828,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 75 /* Identifier */); @@ -16846,8 +16843,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 75 /* Identifier */ || node.kind === 104 /* ThisKeyword */ || node.kind === 102 /* SuperKeyword */ || - node.kind === 195 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 201 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 194 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 200 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -16877,17 +16874,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 154 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 153 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 194 /* ObjectLiteralExpression */ && + return expression.kind === 193 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 193 /* ArrayLiteralExpression */ && + return expression.kind === 192 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17211,8 +17208,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 249 /* EnumDeclaration */: - case 250 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -17289,35 +17286,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return accessKind(parent); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 282 /* PropertyAssignment */: { + case 281 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 227 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 226 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -17466,39 +17463,39 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) + return (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) || kind === 125 /* AnyKeyword */ - || kind === 149 /* UnknownKeyword */ - || kind === 141 /* NumberKeyword */ - || kind === 152 /* BigIntKeyword */ - || kind === 142 /* ObjectKeyword */ - || kind === 129 /* BooleanKeyword */ - || kind === 144 /* StringKeyword */ - || kind === 145 /* SymbolKeyword */ + || kind === 148 /* UnknownKeyword */ + || kind === 140 /* NumberKeyword */ + || kind === 151 /* BigIntKeyword */ + || kind === 141 /* ObjectKeyword */ + || kind === 128 /* BooleanKeyword */ + || kind === 143 /* StringKeyword */ + || kind === 144 /* SymbolKeyword */ || kind === 104 /* ThisKeyword */ || kind === 110 /* VoidKeyword */ - || kind === 147 /* UndefinedKeyword */ + || kind === 146 /* UndefinedKeyword */ || kind === 100 /* NullKeyword */ - || kind === 138 /* NeverKeyword */ - || kind === 217 /* ExpressionWithTypeArguments */ - || kind === 296 /* JSDocAllType */ - || kind === 297 /* JSDocUnknownType */ - || kind === 298 /* JSDocNullableType */ - || kind === 299 /* JSDocNonNullableType */ - || kind === 300 /* JSDocOptionalType */ - || kind === 301 /* JSDocFunctionType */ - || kind === 302 /* JSDocVariadicType */; + || kind === 137 /* NeverKeyword */ + || kind === 216 /* ExpressionWithTypeArguments */ + || kind === 295 /* JSDocAllType */ + || kind === 296 /* JSDocUnknownType */ + || kind === 297 /* JSDocNullableType */ + || kind === 298 /* JSDocNonNullableType */ + || kind === 299 /* JSDocOptionalType */ + || kind === 300 /* JSDocFunctionType */ + || kind === 301 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 195 /* PropertyAccessExpression */ || node.kind === 196 /* ElementAccessExpression */; + return node.kind === 194 /* PropertyAccessExpression */ || node.kind === 195 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 195 /* PropertyAccessExpression */) { + if (node.kind === 194 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 196 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 195 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -17513,7 +17510,7 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 258 /* NamedImports */ || node.kind === 262 /* NamedExports */; + return node.kind === 257 /* NamedImports */ || node.kind === 261 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -18597,21 +18594,21 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 264 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 263 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 75 /* Identifier */ || node.kind === 195 /* PropertyAccessExpression */) { + while (node.kind === 75 /* Identifier */ || node.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } if (hasModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 247 /* InterfaceDeclaration */ || containerKind === 174 /* TypeLiteral */; + return containerKind === 246 /* InterfaceDeclaration */ || containerKind === 173 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { @@ -18619,16 +18616,16 @@ var ts; return false; var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return true; - case 195 /* PropertyAccessExpression */: - case 217 /* ExpressionWithTypeArguments */: + case 194 /* PropertyAccessExpression */: + case 216 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 247 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 113 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 246 /* InterfaceDeclaration */; } })(ts || (ts = {})); var ts; @@ -18648,7 +18645,7 @@ var ts; var PrivateIdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 291 /* SourceFile */) { + if (kind === 290 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 75 /* Identifier */) { @@ -18703,19 +18700,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 153 /* LastToken */) { + if (!node || node.kind <= 152 /* LastToken */) { return; } switch (node.kind) { - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18723,9 +18720,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -18733,7 +18730,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -18741,51 +18738,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -18797,359 +18794,359 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 176 /* TupleType */: + case 175 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 182 /* InferType */: + case 181 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 189 /* ImportType */: + case 188 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 183 /* ParenthesizedType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 184 /* TypeOperator */: return visitNode(cbNode, node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 187 /* MappedType */: + case 186 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return visitNode(cbNode, node.literal); - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 197 /* CallExpression */: - case 198 /* NewExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitNode(cbNode, node.name); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return visitNode(cbNode, node.label); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 158 /* Decorator */: + case 157 /* Decorator */: return visitNode(cbNode, node.expression); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 177 /* OptionalType */: - case 178 /* RestType */: - case 295 /* JSDocTypeExpression */: - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 300 /* JSDocOptionalType */: - case 302 /* JSDocVariadicType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 294 /* JSDocTypeExpression */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 299 /* JSDocOptionalType */: + case 301 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 310 /* JSDocAuthorTag */: + case 309 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 295 /* JSDocTypeExpression */ + node.typeExpression.kind === 294 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 307 /* JSDocTag */: - case 311 /* JSDocClassTag */: - case 312 /* JSDocPublicTag */: - case 313 /* JSDocPrivateTag */: - case 314 /* JSDocProtectedTag */: - case 315 /* JSDocReadonlyTag */: + case 306 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 311 /* JSDocPublicTag */: + case 312 /* JSDocPrivateTag */: + case 313 /* JSDocProtectedTag */: + case 314 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -19438,7 +19435,7 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(227 /* ExpressionStatement */); + var statement = createNode(226 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); @@ -19590,7 +19587,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(291 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(290 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -19922,7 +19919,7 @@ var ts; } function createNodeWithJSDoc(kind, pos) { var node = createNode(kind, pos); - if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 227 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { + if (scanner.getTokenFlags() & 2 /* PrecedingJSDocComment */ && (kind !== 226 /* ExpressionStatement */ || token() !== 20 /* OpenParenToken */)) { addJSDocComment(node); } return node; @@ -20034,7 +20031,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(155 /* ComputedPropertyName */); + var node = createNode(154 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -20076,15 +20073,15 @@ var ts; if (token() === 84 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 146 /* TypeKeyword */) { + if (token() === 145 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); case 84 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); case 120 /* StaticKeyword */: - case 132 /* GetKeyword */: - case 143 /* SetKeyword */: + case 131 /* GetKeyword */: + case 142 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -20494,20 +20491,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 163 /* Constructor */: - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 223 /* SemicolonClassElement */: + case 162 /* Constructor */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 222 /* SemicolonClassElement */: return true; - case 162 /* MethodDeclaration */: + case 161 /* 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 === 75 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 130 /* ConstructorKeyword */; + methodDeclaration.name.originalKeywordKind === 129 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -20516,8 +20513,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: return true; } } @@ -20526,58 +20523,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 226 /* VariableStatement */: - case 224 /* Block */: - case 228 /* IfStatement */: - case 227 /* ExpressionStatement */: - case 240 /* ThrowStatement */: - case 236 /* ReturnStatement */: - case 238 /* SwitchStatement */: - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 231 /* ForStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 225 /* EmptyStatement */: - case 241 /* TryStatement */: - case 239 /* LabeledStatement */: - case 229 /* DoStatement */: - case 242 /* DebuggerStatement */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 225 /* VariableStatement */: + case 223 /* Block */: + case 227 /* IfStatement */: + case 226 /* ExpressionStatement */: + case 239 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 237 /* SwitchStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 230 /* ForStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 224 /* EmptyStatement */: + case 240 /* TryStatement */: + case 238 /* LabeledStatement */: + case 228 /* DoStatement */: + case 241 /* DebuggerStatement */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 285 /* EnumMember */; + return node.kind === 284 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 159 /* PropertySignature */: - case 166 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 158 /* PropertySignature */: + case 165 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 243 /* VariableDeclaration */) { + if (node.kind !== 242 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -20598,7 +20595,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 157 /* Parameter */) { + if (node.kind !== 156 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -20737,7 +20734,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(154 /* QualifiedName */, entity.pos); + var node = createNode(153 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -20778,7 +20775,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression(isTaggedTemplate) { - var template = createNode(212 /* TemplateExpression */); + var template = createNode(211 /* TemplateExpression */); template.head = parseTemplateHead(isTaggedTemplate); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -20790,7 +20787,7 @@ var ts; return finishNode(template); } function parseTemplateSpan(isTaggedTemplate) { - var span = createNode(222 /* TemplateSpan */); + var span = createNode(221 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -20856,7 +20853,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); @@ -20866,14 +20863,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: { + case 170 /* FunctionType */: + case 171 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -20881,20 +20878,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(169 /* TypePredicate */, lhs.pos); + var node = createNode(168 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(184 /* ThisType */); + var node = createNode(183 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(296 /* JSDocAllType */); + var result = createNode(295 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(300 /* JSDocOptionalType */, result); + return createPostfixType(299 /* JSDocOptionalType */, result); } else { nextToken(); @@ -20902,7 +20899,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(299 /* JSDocNonNullableType */); + var result = createNode(298 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -20926,28 +20923,28 @@ var ts; token() === 31 /* GreaterThanToken */ || token() === 62 /* EqualsToken */ || token() === 51 /* BarToken */) { - var result = createNode(297 /* JSDocUnknownType */, pos); + var result = createNode(296 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(298 /* JSDocNullableType */, pos); + var result = createNode(297 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(301 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(300 /* JSDocFunctionType */); nextToken(); fillSignature(58 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(170 /* TypeReference */); + var node = createNode(169 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(157 /* Parameter */); + var parameter = createNode(156 /* Parameter */); if (token() === 104 /* ThisKeyword */ || token() === 99 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(58 /* ColonToken */); @@ -20957,9 +20954,9 @@ var ts; } function parseJSDocType() { scanner.setInJSDocType(true); - var moduleSpecifier = parseOptionalToken(136 /* ModuleKeyword */); + var moduleSpecifier = parseOptionalToken(135 /* ModuleKeyword */); if (moduleSpecifier) { - var moduleTag = createNode(303 /* JSDocNamepathType */, moduleSpecifier.pos); + var moduleTag = createNode(302 /* JSDocNamepathType */, moduleSpecifier.pos); terminate: while (true) { switch (token()) { case 19 /* CloseBraceToken */: @@ -20978,23 +20975,23 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(302 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(301 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } if (token() === 62 /* EqualsToken */) { - return createPostfixType(300 /* JSDocOptionalType */, type); + return createPostfixType(299 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(173 /* TypeQuery */); + var node = createNode(172 /* TypeQuery */); parseExpected(108 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(90 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -21039,7 +21036,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(157 /* Parameter */); + var node = createNodeWithJSDoc(156 /* Parameter */); if (token() === 104 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -21140,7 +21137,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 167 /* ConstructSignature */) { + if (kind === 166 /* ConstructSignature */) { parseExpected(99 /* NewKeyword */); } fillSignature(58 /* ColonToken */, 4 /* Type */, node); @@ -21201,7 +21198,7 @@ var ts; return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 168 /* IndexSignature */; + node.kind = 167 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -21211,13 +21208,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(57 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - node.kind = 161 /* MethodSignature */; + node.kind = 160 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(58 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 159 /* PropertySignature */; + node.kind = 158 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 62 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -21263,10 +21260,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(166 /* CallSignature */); + return parseSignatureMember(165 /* CallSignature */); } if (token() === 99 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(167 /* ConstructSignature */); + return parseSignatureMember(166 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -21292,7 +21289,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(174 /* TypeLiteral */); + var node = createNode(173 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -21310,27 +21307,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 139 /* ReadonlyKeyword */; + return nextToken() === 138 /* ReadonlyKeyword */; } - if (token() === 139 /* ReadonlyKeyword */) { + if (token() === 138 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 97 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(156 /* TypeParameter */); + var node = createNode(155 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(97 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(187 /* MappedType */); + var node = createNode(186 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 139 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 138 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { - parseExpectedToken(139 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { + parseExpectedToken(138 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -21350,23 +21347,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(178 /* RestType */, pos); + var node = createNode(177 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 298 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 177 /* OptionalType */; + if (!(contextFlags & 4194304 /* JSDoc */) && type.kind === 297 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 176 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(176 /* TupleType */); + var node = createNode(175 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(183 /* ParenthesizedType */); + var node = createNode(182 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -21374,7 +21371,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(99 /* NewKeyword */) ? 172 /* ConstructorType */ : 171 /* FunctionType */; + var kind = parseOptional(99 /* NewKeyword */) ? 171 /* ConstructorType */ : 170 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(38 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -21384,10 +21381,10 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(188 /* LiteralType */); + var node = createNode(187 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(208 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(207 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 40 /* MinusToken */; nextToken(); } @@ -21408,7 +21405,7 @@ var ts; } function parseImportType() { sourceFile.flags |= 1048576 /* PossiblyContainsDynamicImport */; - var node = createNode(189 /* ImportType */); + var node = createNode(188 /* ImportType */); if (parseOptional(108 /* TypeOfKeyword */)) { node.isTypeOf = true; } @@ -21431,15 +21428,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 145 /* SymbolKeyword */: - case 129 /* BooleanKeyword */: - case 147 /* UndefinedKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 144 /* SymbolKeyword */: + case 128 /* BooleanKeyword */: + case 146 /* UndefinedKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 41 /* AsteriskToken */: @@ -21470,7 +21467,7 @@ var ts; return parseTokenNode(); case 104 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -21496,20 +21493,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 139 /* ReadonlyKeyword */: - case 145 /* SymbolKeyword */: - case 148 /* UniqueKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 138 /* ReadonlyKeyword */: + case 144 /* SymbolKeyword */: + case 147 /* UniqueKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: case 104 /* ThisKeyword */: case 108 /* TypeOfKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -21521,12 +21518,12 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: case 96 /* ImportKeyword */: case 124 /* AssertsKeyword */: return true; @@ -21551,26 +21548,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 53 /* ExclamationToken */: - type = createPostfixType(299 /* JSDocNonNullableType */, type); + type = createPostfixType(298 /* JSDocNonNullableType */, type); break; case 57 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 4194304 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(298 /* JSDocNullableType */, type); + type = createPostfixType(297 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(186 /* IndexedAccessType */, type.pos); + var node = createNode(185 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(175 /* ArrayType */, type.pos); + var node = createNode(174 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -21589,16 +21586,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(185 /* TypeOperator */); + var node = createNode(184 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(182 /* InferType */); - parseExpected(133 /* InferKeyword */); - var typeParameter = createNode(156 /* TypeParameter */); + var node = createNode(181 /* InferType */); + parseExpected(132 /* InferKeyword */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -21606,12 +21603,11 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 135 /* KeyOfKeyword */: - case 148 /* UniqueKeyword */: - case 139 /* ReadonlyKeyword */: - case 128 /* AwaitedKeyword */: + case 134 /* KeyOfKeyword */: + case 147 /* UniqueKeyword */: + case 138 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 133 /* InferKeyword */: + case 132 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); @@ -21632,10 +21628,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(180 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); + return parseUnionOrIntersectionType(179 /* IntersectionType */, parseTypeOperatorOrHigher, 50 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(179 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); + return parseUnionOrIntersectionType(178 /* UnionType */, parseIntersectionTypeOrHigher, 51 /* BarToken */); } function isStartOfFunctionType() { if (token() === 29 /* LessThanToken */) { @@ -21692,7 +21688,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(169 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(168 /* TypePredicate */, typePredicateVariable.pos); node.assertsModifier = undefined; node.parameterName = typePredicateVariable; node.type = type; @@ -21704,16 +21700,16 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 134 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 133 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } } function parseAssertsTypePredicate() { - var node = createNode(169 /* TypePredicate */); + var node = createNode(168 /* TypePredicate */); node.assertsModifier = parseExpectedToken(124 /* AssertsKeyword */); node.parameterName = token() === 104 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - node.type = parseOptional(134 /* IsKeyword */) ? parseType() : undefined; + node.type = parseOptional(133 /* IsKeyword */) ? parseType() : undefined; return finishNode(node); } function parseType() { @@ -21727,7 +21723,7 @@ var ts; } var type = parseUnionTypeOrHigher(); if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(90 /* ExtendsKeyword */)) { - var node = createNode(181 /* ConditionalType */, type.pos); + var node = createNode(180 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -21922,7 +21918,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(213 /* YieldExpression */); + var node = createNode(212 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -21944,13 +21940,13 @@ var ts; ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(203 /* ArrowFunction */, asyncModifier.pos); + node = createNode(202 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(203 /* ArrowFunction */, identifier.pos); + node = createNode(202 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(157 /* Parameter */, identifier.pos); + var parameter = createNode(156 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -22155,7 +22151,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(203 /* ArrowFunction */); + var node = createNodeWithJSDoc(202 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -22221,7 +22217,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(211 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(210 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -22236,7 +22232,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 97 /* InKeyword */ || t === 153 /* OfKeyword */; + return t === 97 /* InKeyword */ || t === 152 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -22301,39 +22297,39 @@ var ts; return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(210 /* BinaryExpression */, left.pos); + var node = createNode(209 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(218 /* AsExpression */, left.pos); + var node = createNode(217 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(204 /* DeleteExpression */); + var node = createNode(203 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(205 /* TypeOfExpression */); + var node = createNode(204 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(206 /* VoidExpression */); + var node = createNode(205 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22349,7 +22345,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(207 /* AwaitExpression */); + var node = createNode(206 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -22393,7 +22389,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 200 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 199 /* TypeAssertionExpression */) { parseErrorAt(pos, end, 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 { @@ -22490,7 +22486,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { - var node = createNode(208 /* PrefixUnaryExpression */); + var node = createNode(207 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -22503,7 +22499,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(209 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(208 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -22559,7 +22555,7 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(220 /* MetaProperty */, fullStart); + var node = createNode(219 /* MetaProperty */, fullStart); node.keywordToken = 96 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); @@ -22642,7 +22638,7 @@ var ts; } // 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(195 /* PropertyAccessExpression */, expression.pos); + var node = createNode(194 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic @@ -22652,8 +22648,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 269 /* JsxOpeningElement */) { - var node = createNode(267 /* JsxElement */, opening.pos); + if (opening.kind === 268 /* JsxOpeningElement */) { + var node = createNode(266 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -22662,15 +22658,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 272 /* JsxOpeningFragment */) { - var node = createNode(271 /* JsxFragment */, opening.pos); + else if (opening.kind === 271 /* JsxOpeningFragment */) { + var node = createNode(270 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 268 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 267 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -22685,7 +22681,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(210 /* BinaryExpression */, result.pos); + var badNode = createNode(209 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -22748,7 +22744,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(275 /* JsxAttributes */); + var jsxAttributes = createNode(274 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -22757,7 +22753,7 @@ var ts; parseExpected(29 /* LessThanToken */); if (token() === 31 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(272 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(271 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -22769,7 +22765,7 @@ var ts; // 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(269 /* JsxOpeningElement */, fullStart); + node = createNode(268 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -22781,7 +22777,7 @@ var ts; parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(268 /* JsxSelfClosingElement */, fullStart); + node = createNode(267 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -22798,7 +22794,7 @@ var ts; var expression = token() === 104 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false); expression = finishNode(propertyAccess); @@ -22806,7 +22802,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(277 /* JsxExpression */); + var node = createNode(276 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -22832,7 +22828,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(274 /* JsxAttribute */); + var node = createNode(273 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 62 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -22847,7 +22843,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(276 /* JsxSpreadAttribute */); + var node = createNode(275 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -22855,7 +22851,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(270 /* JsxClosingElement */); + var node = createNode(269 /* JsxClosingElement */); parseExpected(30 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -22868,7 +22864,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(273 /* JsxClosingFragment */); + var node = createNode(272 /* JsxClosingFragment */); parseExpected(30 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -22883,7 +22879,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(200 /* TypeAssertionExpression */); + var node = createNode(199 /* TypeAssertionExpression */); parseExpected(29 /* LessThanToken */); node.type = parseType(); parseExpected(31 /* GreaterThanToken */); @@ -22900,12 +22896,33 @@ var ts; return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } + function tryReparseOptionalChain(node) { + if (node.flags & 32 /* OptionalChain */) { + return true; + } + // check for an optional chain in a non-null expression + if (ts.isNonNullExpression(node)) { + var expr = node.expression; + while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + expr = expr.expression; + } + if (expr.flags & 32 /* OptionalChain */) { + // this is part of an optional chain. Walk down from `node` to `expression` and set the flag. + while (ts.isNonNullExpression(node)) { + node.flags |= 32 /* OptionalChain */; + node = node.expression; + } + return true; + } + } + return false; + } function parsePropertyAccessExpressionRest(expression, questionDotToken) { - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { propertyAccess.flags |= 32 /* OptionalChain */; if (ts.isPrivateIdentifier(propertyAccess.name)) { parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); @@ -22914,7 +22931,7 @@ var ts; return finishNode(propertyAccess); } function parseElementAccessExpressionRest(expression, questionDotToken) { - var indexedAccess = createNode(196 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(195 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; indexedAccess.questionDotToken = questionDotToken; if (token() === 23 /* CloseBracketToken */) { @@ -22928,7 +22945,7 @@ var ts; indexedAccess.argumentExpression = argument; } parseExpected(23 /* CloseBracketToken */); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { indexedAccess.flags |= 32 /* OptionalChain */; } return finishNode(indexedAccess); @@ -22950,7 +22967,7 @@ var ts; } if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(219 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(218 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; @@ -22971,7 +22988,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, questionDotToken, typeArguments) { - var tagExpression = createNode(199 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(198 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.questionDotToken = questionDotToken; tagExpression.typeArguments = typeArguments; @@ -22999,12 +23016,12 @@ var ts; expression = parseTaggedTemplateRest(expression, questionDotToken, typeArguments); continue; } - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23012,11 +23029,11 @@ var ts; } } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(197 /* CallExpression */, expression.pos); + var callExpr = createNode(196 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.questionDotToken = questionDotToken; callExpr.arguments = parseArgumentList(); - if (questionDotToken || expression.flags & 32 /* OptionalChain */) { + if (questionDotToken || tryReparseOptionalChain(expression)) { callExpr.flags |= 32 /* OptionalChain */; } expression = finishNode(callExpr); @@ -23024,7 +23041,7 @@ var ts; } if (questionDotToken) { // We failed to parse anything, so report a missing identifier here. - var propertyAccess = createNode(195 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(194 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.questionDotToken = questionDotToken; propertyAccess.name = createMissingNode(75 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); @@ -23143,28 +23160,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(201 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(200 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(214 /* SpreadElement */); + var node = createNode(213 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(216 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(215 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(193 /* ArrayLiteralExpression */); + var node = createNode(192 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -23176,17 +23193,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 284 /* SpreadAssignment */; + node.kind = 283 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -23204,7 +23221,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 283 /* ShorthandPropertyAssignment */; + node.kind = 282 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(62 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -23212,14 +23229,14 @@ var ts; } } else { - node.kind = 282 /* PropertyAssignment */; + node.kind = 281 /* PropertyAssignment */; parseExpected(58 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(194 /* ObjectLiteralExpression */); + var node = createNode(193 /* ObjectLiteralExpression */); var openBracePosition = scanner.getTokenPos(); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { @@ -23244,7 +23261,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(202 /* FunctionExpression */); + var node = createNodeWithJSDoc(201 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); @@ -23269,7 +23286,7 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(99 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(220 /* MetaProperty */, fullStart); + var node_2 = createNode(219 /* MetaProperty */, fullStart); node_2.keywordToken = 99 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); @@ -23286,7 +23303,7 @@ var ts; } break; } - var node = createNode(198 /* NewExpression */, fullStart); + var node = createNode(197 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -23296,7 +23313,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(224 /* Block */); + var node = createNode(223 /* Block */); var openBracePosition = scanner.getTokenPos(); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { @@ -23335,12 +23352,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(225 /* EmptyStatement */); + var node = createNode(224 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(228 /* IfStatement */); + var node = createNode(227 /* IfStatement */); parseExpected(95 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23350,7 +23367,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(229 /* DoStatement */); + var node = createNode(228 /* DoStatement */); parseExpected(86 /* DoKeyword */); node.statement = parseStatement(); parseExpected(111 /* WhileKeyword */); @@ -23365,7 +23382,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(230 /* WhileStatement */); + var node = createNode(229 /* WhileStatement */); parseExpected(111 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23388,8 +23405,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(153 /* OfKeyword */) : parseOptional(153 /* OfKeyword */)) { - var forOfStatement = createNode(233 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(152 /* OfKeyword */) : parseOptional(152 /* OfKeyword */)) { + var forOfStatement = createNode(232 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -23397,14 +23414,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(97 /* InKeyword */)) { - var forInStatement = createNode(232 /* ForInStatement */, pos); + var forInStatement = createNode(231 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(231 /* ForStatement */, pos); + var forStatement = createNode(230 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -23422,7 +23439,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 235 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); + parseExpected(kind === 234 /* BreakStatement */ ? 77 /* BreakKeyword */ : 82 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -23430,7 +23447,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(236 /* ReturnStatement */); + var node = createNode(235 /* ReturnStatement */); parseExpected(101 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -23439,7 +23456,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(237 /* WithStatement */); + var node = createNode(236 /* WithStatement */); parseExpected(112 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -23448,7 +23465,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(278 /* CaseClause */); + var node = createNode(277 /* CaseClause */); parseExpected(78 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(58 /* ColonToken */); @@ -23456,7 +23473,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(279 /* DefaultClause */); + var node = createNode(278 /* DefaultClause */); parseExpected(84 /* DefaultKeyword */); parseExpected(58 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -23466,12 +23483,12 @@ var ts; return token() === 78 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(238 /* SwitchStatement */); + var node = createNode(237 /* SwitchStatement */); parseExpected(103 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(252 /* CaseBlock */); + var caseBlock = createNode(251 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -23486,7 +23503,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(240 /* ThrowStatement */); + var node = createNode(239 /* ThrowStatement */); parseExpected(105 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -23494,7 +23511,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(241 /* TryStatement */); + var node = createNode(240 /* TryStatement */); parseExpected(107 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 79 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -23507,7 +23524,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(281 /* CatchClause */); + var result = createNode(280 /* CatchClause */); parseExpected(79 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -23521,7 +23538,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(242 /* DebuggerStatement */); + var node = createNode(241 /* DebuggerStatement */); parseExpected(83 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -23530,15 +23547,15 @@ var ts; // Avoiding having to do the lookahead for a labeled statement by just trying to parse // out an expression, seeing if it is identifier and then seeing if it is followed by // a colon. - var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 227 /* ExpressionStatement */); + var node = createNodeWithJSDoc(token() === 75 /* Identifier */ ? 0 /* Unknown */ : 226 /* ExpressionStatement */); var expression = allowInAnd(parseExpression); if (expression.kind === 75 /* Identifier */ && parseOptional(58 /* ColonToken */)) { - node.kind = 239 /* LabeledStatement */; + node.kind = 238 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 227 /* ExpressionStatement */; + node.kind = 226 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -23592,25 +23609,25 @@ var ts; // // could be legal, it would add complexity for very little gain. case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 122 /* AbstractKeyword */: case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 119 /* PublicKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 151 /* GlobalKeyword */: + case 150 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 75 /* Identifier */ || token() === 89 /* ExportKeyword */; case 96 /* ImportKeyword */: @@ -23619,7 +23636,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 89 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 146 /* TypeKeyword */) { + if (currentToken_1 === 145 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -23673,19 +23690,19 @@ var ts; case 89 /* ExportKeyword */: return isStartOfDeclaration(); case 126 /* AsyncKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 114 /* InterfaceKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 146 /* TypeKeyword */: - case 151 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 145 /* TypeKeyword */: + case 150 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -23709,16 +23726,16 @@ var ts; case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 109 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); case 115 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(243 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(242 /* VariableDeclaration */)); } break; case 94 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(245 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(244 /* FunctionDeclaration */)); case 80 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(246 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(245 /* ClassDeclaration */)); case 95 /* IfKeyword */: return parseIfStatement(); case 86 /* DoKeyword */: @@ -23728,9 +23745,9 @@ var ts; case 93 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 82 /* ContinueKeyword */: - return parseBreakOrContinueStatement(234 /* ContinueStatement */); + return parseBreakOrContinueStatement(233 /* ContinueStatement */); case 77 /* BreakKeyword */: - return parseBreakOrContinueStatement(235 /* BreakStatement */); + return parseBreakOrContinueStatement(234 /* BreakStatement */); case 101 /* ReturnKeyword */: return parseReturnStatement(); case 112 /* WithKeyword */: @@ -23751,10 +23768,10 @@ var ts; return parseDeclaration(); case 126 /* AsyncKeyword */: case 114 /* InterfaceKeyword */: - case 146 /* TypeKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: - case 131 /* DeclareKeyword */: + case 145 /* TypeKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: case 88 /* EnumKeyword */: case 89 /* ExportKeyword */: @@ -23764,8 +23781,8 @@ var ts; case 119 /* PublicKeyword */: case 122 /* AbstractKeyword */: case 120 /* StaticKeyword */: - case 139 /* ReadonlyKeyword */: - case 151 /* GlobalKeyword */: + case 138 /* ReadonlyKeyword */: + case 150 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -23774,7 +23791,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 131 /* DeclareKeyword */; + return modifier.kind === 130 /* DeclareKeyword */; } function parseDeclaration() { var modifiers = lookAhead(function () { return (parseDecorators(), parseModifiers()); }); @@ -23822,13 +23839,13 @@ var ts; return parseClassDeclaration(node); case 114 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 146 /* TypeKeyword */: + case 145 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 88 /* EnumKeyword */: return parseEnumDeclaration(node); - case 151 /* GlobalKeyword */: - case 136 /* ModuleKeyword */: - case 137 /* NamespaceKeyword */: + case 150 /* GlobalKeyword */: + case 135 /* ModuleKeyword */: + case 136 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 96 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -23847,7 +23864,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(265 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(264 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -23870,16 +23887,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(216 /* OmittedExpression */); + return createNode(215 /* OmittedExpression */); } - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(192 /* BindingElement */); + var node = createNode(191 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -23895,14 +23912,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(190 /* ObjectBindingPattern */); + var node = createNode(189 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(191 /* ArrayBindingPattern */); + var node = createNode(190 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -23927,7 +23944,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(243 /* VariableDeclaration */); + var node = createNode(242 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); if (allowExclamation && node.name.kind === 75 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -23940,7 +23957,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(244 /* VariableDeclarationList */); + var node = createNode(243 /* VariableDeclarationList */); switch (token()) { case 109 /* VarKeyword */: break; @@ -23963,7 +23980,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 153 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 152 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -23978,13 +23995,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 226 /* VariableStatement */; + node.kind = 225 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 245 /* FunctionDeclaration */; + node.kind = 244 /* FunctionDeclaration */; parseExpected(94 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(41 /* AsteriskToken */); node.name = hasModifierOfKind(node, 84 /* DefaultKeyword */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -23995,8 +24012,8 @@ var ts; return finishNode(node); } function parseConstructorName() { - if (token() === 130 /* ConstructorKeyword */) { - return parseExpected(130 /* ConstructorKeyword */); + if (token() === 129 /* ConstructorKeyword */) { + return parseExpected(129 /* ConstructorKeyword */); } if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { return tryParse(function () { @@ -24008,7 +24025,7 @@ var ts; function tryParseConstructorDeclaration(node) { return tryParse(function () { if (parseConstructorName()) { - node.kind = 163 /* Constructor */; + node.kind = 162 /* Constructor */; fillSignature(58 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); @@ -24016,7 +24033,7 @@ var ts; }); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 162 /* MethodDeclaration */; + node.kind = 161 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = hasModifierOfKind(node, 126 /* AsyncKeyword */) ? 2 /* Await */ : 0 /* None */; @@ -24025,7 +24042,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 160 /* PropertyDeclaration */; + node.kind = 159 /* PropertyDeclaration */; if (!node.questionToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -24087,7 +24104,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 143 /* SetKeyword */ || idToken === 132 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 142 /* SetKeyword */ || idToken === 131 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -24119,7 +24136,7 @@ var ts; if (!parseOptional(59 /* AtToken */)) { break; } - var decorator = createNode(158 /* Decorator */, decoratorStart); + var decorator = createNode(157 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -24169,20 +24186,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(223 /* SemicolonClassElement */); + var result = createNode(222 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(132 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 164 /* GetAccessor */); + if (parseContextualModifier(131 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 163 /* GetAccessor */); } - if (parseContextualModifier(143 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 165 /* SetAccessor */); + if (parseContextualModifier(142 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 164 /* SetAccessor */); } - if (token() === 130 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { + if (token() === 129 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(node); if (constructorDeclaration) { return constructorDeclaration; @@ -24219,10 +24236,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 215 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 214 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 246 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 245 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -24265,14 +24282,14 @@ var ts; function parseHeritageClause() { var tok = token(); ts.Debug.assert(tok === 90 /* ExtendsKeyword */ || tok === 113 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(280 /* HeritageClause */); + var node = createNode(279 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -24288,7 +24305,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 247 /* InterfaceDeclaration */; + node.kind = 246 /* InterfaceDeclaration */; parseExpected(114 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -24297,8 +24314,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 248 /* TypeAliasDeclaration */; - parseExpected(146 /* TypeKeyword */); + node.kind = 247 /* TypeAliasDeclaration */; + parseExpected(145 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); @@ -24311,13 +24328,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(285 /* EnumMember */); + var node = createNodeWithJSDoc(284 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 249 /* EnumDeclaration */; + node.kind = 248 /* EnumDeclaration */; parseExpected(88 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { @@ -24330,7 +24347,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(251 /* ModuleBlock */); + var node = createNode(250 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -24341,7 +24358,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 250 /* ModuleDeclaration */; + node.kind = 249 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -24353,8 +24370,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 250 /* ModuleDeclaration */; - if (token() === 151 /* GlobalKeyword */) { + node.kind = 249 /* ModuleDeclaration */; + if (token() === 150 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 1024 /* GlobalAugmentation */; @@ -24373,15 +24390,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 151 /* GlobalKeyword */) { + if (token() === 150 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(137 /* NamespaceKeyword */)) { + else if (parseOptional(136 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(136 /* ModuleKeyword */); + parseExpected(135 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -24389,7 +24406,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 140 /* RequireKeyword */ && + return token() === 139 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -24399,9 +24416,9 @@ var ts; return nextToken() === 43 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 253 /* NamespaceExportDeclaration */; + node.kind = 252 /* NamespaceExportDeclaration */; parseExpected(123 /* AsKeyword */); - parseExpected(137 /* NamespaceKeyword */); + parseExpected(136 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -24414,7 +24431,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 150 /* FromKeyword */ && + if (token() !== 149 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -24424,7 +24441,7 @@ var ts; return parseImportEqualsDeclaration(node, identifier, isTypeOnly); } // Import statement - node.kind = 255 /* ImportDeclaration */; + node.kind = 254 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -24433,7 +24450,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { node.importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -24445,10 +24462,10 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 150 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 149 /* FromKeyword */; } function parseImportEqualsDeclaration(node, identifier, isTypeOnly) { - node.kind = 254 /* ImportEqualsDeclaration */; + node.kind = 253 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(62 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -24466,7 +24483,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(256 /* ImportClause */, fullStart); + var importClause = createNode(255 /* ImportClause */, fullStart); importClause.isTypeOnly = isTypeOnly; if (identifier) { // ImportedDefaultBinding: @@ -24477,7 +24494,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(258 /* NamedImports */); + importClause.namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(257 /* NamedImports */); } return finishNode(importClause); } @@ -24487,8 +24504,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(266 /* ExternalModuleReference */); - parseExpected(140 /* RequireKeyword */); + var node = createNode(265 /* ExternalModuleReference */); + parseExpected(139 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -24510,7 +24527,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(257 /* NamespaceImport */); + var namespaceImport = createNode(256 /* NamespaceImport */); parseExpected(41 /* AsteriskToken */); parseExpected(123 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -24525,14 +24542,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 258 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 257 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(264 /* ExportSpecifier */); + return parseImportOrExportSpecifier(263 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(259 /* ImportSpecifier */); + return parseImportOrExportSpecifier(258 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -24557,34 +24574,34 @@ var ts; else { node.name = identifierName; } - if (kind === 259 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 258 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseNamespaceExport(pos) { - var node = createNode(263 /* NamespaceExport */, pos); + var node = createNode(262 /* NamespaceExport */, pos); node.name = parseIdentifier(); return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 261 /* ExportDeclaration */; - node.isTypeOnly = parseOptional(146 /* TypeKeyword */); + node.kind = 260 /* ExportDeclaration */; + node.isTypeOnly = parseOptional(145 /* TypeKeyword */); var namespaceExportPos = scanner.getStartPos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(123 /* AsKeyword */)) { node.exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(150 /* FromKeyword */); + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(262 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(261 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 150 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(150 /* FromKeyword */); + if (token() === 149 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(149 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -24592,7 +24609,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 260 /* ExportAssignment */; + node.kind = 259 /* ExportAssignment */; if (parseOptional(62 /* EqualsToken */)) { node.isExportEquals = true; } @@ -24612,10 +24629,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return hasModifierOfKind(node, 89 /* ExportKeyword */) - || node.kind === 254 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 266 /* ExternalModuleReference */ - || node.kind === 255 /* ImportDeclaration */ - || node.kind === 260 /* ExportAssignment */ - || node.kind === 261 /* ExportDeclaration */ ? node : undefined; + || node.kind === 253 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 265 /* ExternalModuleReference */ + || node.kind === 254 /* ImportDeclaration */ + || node.kind === 259 /* ExportAssignment */ + || node.kind === 260 /* ExportDeclaration */ ? node : undefined; } function getImportMetaIfNecessary(sourceFile) { return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ? @@ -24681,7 +24698,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(295 /* JSDocTypeExpression */); + var result = createNode(294 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { @@ -24844,7 +24861,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(304 /* JSDocComment */, start); + var result = createNode(303 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -24914,19 +24931,19 @@ var ts; break; case "class": case "constructor": - tag = parseSimpleTag(start, 311 /* JSDocClassTag */, tagName); + tag = parseSimpleTag(start, 310 /* JSDocClassTag */, tagName); break; case "public": - tag = parseSimpleTag(start, 312 /* JSDocPublicTag */, tagName); + tag = parseSimpleTag(start, 311 /* JSDocPublicTag */, tagName); break; case "private": - tag = parseSimpleTag(start, 313 /* JSDocPrivateTag */, tagName); + tag = parseSimpleTag(start, 312 /* JSDocPrivateTag */, tagName); break; case "protected": - tag = parseSimpleTag(start, 314 /* JSDocProtectedTag */, tagName); + tag = parseSimpleTag(start, 313 /* JSDocProtectedTag */, tagName); break; case "readonly": - tag = parseSimpleTag(start, 315 /* JSDocReadonlyTag */, tagName); + tag = parseSimpleTag(start, 314 /* JSDocReadonlyTag */, tagName); break; case "this": tag = parseThisTag(start, tagName); @@ -25061,7 +25078,7 @@ var ts; return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(307 /* JSDocTag */, start); + var result = createNode(306 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -25106,9 +25123,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -25124,8 +25141,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(324 /* JSDocPropertyTag */, start) : - createNode(318 /* JSDocParameterTag */, start); + createNode(323 /* JSDocPropertyTag */, start) : + createNode(317 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -25142,20 +25159,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(295 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(294 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_3 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) { + if (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start_3); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -25167,7 +25184,7 @@ var ts; if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(319 /* JSDocReturnTag */, start); + var result = createNode(318 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); @@ -25176,13 +25193,13 @@ var ts; if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(321 /* JSDocTypeTag */, start); + var result = createNode(320 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAuthorTag(start, tagName, indent) { - var result = createNode(310 /* JSDocAuthorTag */, start); + var result = createNode(309 /* JSDocAuthorTag */, start); result.tagName = tagName; var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -25236,20 +25253,20 @@ var ts; } } function parseImplementsTag(start, tagName) { - var result = createNode(309 /* JSDocImplementsTag */, start); + var result = createNode(308 /* JSDocImplementsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(308 /* JSDocAugmentsTag */, start); + var result = createNode(307 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(217 /* ExpressionWithTypeArguments */); + var node = createNode(216 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -25261,7 +25278,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(195 /* PropertyAccessExpression */, node.pos); + var prop = createNode(194 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -25274,14 +25291,14 @@ var ts; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(320 /* JSDocThisTag */, start); + var tag = createNode(319 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(317 /* JSDocEnumTag */, start); + var tag = createNode(316 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -25290,7 +25307,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(323 /* JSDocTypedefTag */, start); + var typedefTag = createNode(322 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -25304,9 +25321,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(305 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(304 /* JSDocTypeLiteral */, start); } - if (child.kind === 321 /* JSDocTypeTag */) { + if (child.kind === 320 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -25319,7 +25336,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 175 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 174 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -25338,7 +25355,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(250 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(249 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -25352,14 +25369,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(316 /* JSDocCallbackTag */, start); + var callbackTag = createNode(315 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(306 /* JSDocSignature */, start); + var jsdocSignature = createNode(305 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -25367,7 +25384,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 319 /* JSDocReturnTag */) { + if (tag && tag.kind === 318 /* JSDocReturnTag */) { return tag; } } @@ -25412,7 +25429,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 318 /* JSDocParameterTag */ || child.kind === 324 /* JSDocPropertyTag */) && + if (child && (child.kind === 317 /* JSDocParameterTag */ || child.kind === 323 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -25476,13 +25493,13 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(156 /* TypeParameter */); + var typeParameter = createNode(155 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespaceOrAsterisk(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(322 /* JSDocTemplateTag */, start); + var result = createNode(321 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); @@ -27791,7 +27808,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_3 = function (element) { - if (element.kind !== 282 /* PropertyAssignment */) { + if (element.kind !== 281 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -27882,13 +27899,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -27905,7 +27922,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30333,26 +30350,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 262 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 261 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -30368,7 +30385,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 251 /* ModuleBlock */: { + case 250 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -30390,7 +30407,7 @@ var ts; }); return state_1; } - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 75 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -30598,7 +30615,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 260 /* ExportAssignment */) { + if (node.kind === 259 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -30607,7 +30624,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -30635,36 +30652,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return "__constructor" /* Constructor */; - case 171 /* FunctionType */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: return "__call" /* Call */; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: return "__new" /* New */; - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return "__index" /* Index */; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 157 /* Parameter */: + case 156 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 301 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 300 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -30764,7 +30781,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 260 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 259 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -30803,7 +30820,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 264 /* ExportSpecifier */ || (node.kind === 254 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 263 /* ExportSpecifier */ || (node.kind === 253 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -30870,7 +30887,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -30903,7 +30920,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 163 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 162 /* Constructor */ ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -30918,13 +30935,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -30968,8 +30985,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 245 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 244 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -31001,90 +31018,93 @@ var ts; bindJSDoc(node); return; } - if (node.kind >= 226 /* FirstStatement */ && node.kind <= 242 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 225 /* FirstStatement */ && node.kind <= 241 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: bindWhileStatement(node); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: bindDoStatement(node); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: bindForStatement(node); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: bindIfStatement(node); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: bindTryStatement(node); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: bindSwitchStatement(node); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: bindCaseBlock(node); break; - case 278 /* CaseClause */: + case 277 /* CaseClause */: bindCaseClause(node); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: bindLabeledStatement(node); break; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: bindCallExpressionFlow(node); break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 218 /* NonNullExpression */: + bindNonNullExpressionFlow(node); + break; + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 291 /* SourceFile */: { + case 290 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -31097,18 +31117,18 @@ var ts; switch (expr.kind) { case 75 /* Identifier */: case 104 /* ThisKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return hasNarrowableArgument(expr); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -31130,7 +31150,7 @@ var ts; } } } - if (expr.expression.kind === 195 /* PropertyAccessExpression */ && + if (expr.expression.kind === 194 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -31163,9 +31183,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -31241,26 +31261,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 228 /* IfStatement */: - case 230 /* WhileStatement */: - case 229 /* DoStatement */: + case 227 /* IfStatement */: + case 229 /* WhileStatement */: + case 228 /* DoStatement */: return parent.expression === node; - case 231 /* ForStatement */: - case 211 /* ConditionalExpression */: + case 230 /* ForStatement */: + case 210 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 201 /* ParenthesizedExpression */) { + if (node.kind === 200 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 208 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 207 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -31302,7 +31322,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 239 /* LabeledStatement */) { + while (label && node.parent.kind === 238 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -31353,12 +31373,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 233 /* ForOfStatement */) { + if (node.kind === 232 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 244 /* VariableDeclarationList */) { + if (node.initializer.kind !== 243 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -31380,7 +31400,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 236 /* ReturnStatement */) { + if (node.kind === 235 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -31397,7 +31417,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 235 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 234 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -31497,7 +31517,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 279 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 278 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -31546,7 +31566,7 @@ var ts; bind(node.expression); // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.expression.kind === 197 /* CallExpression */) { + if (node.expression.kind === 196 /* CallExpression */) { var call = node.expression; if (ts.isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -31572,7 +31592,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -31583,10 +31603,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 193 /* ArrayLiteralExpression */) { + else if (node.kind === 192 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 214 /* SpreadElement */) { + if (e.kind === 213 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -31594,16 +31614,16 @@ var ts; } } } - else if (node.kind === 194 /* ObjectLiteralExpression */) { + else if (node.kind === 193 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 282 /* PropertyAssignment */) { + if (p.kind === 281 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 283 /* ShorthandPropertyAssignment */) { + else if (p.kind === 282 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 284 /* SpreadAssignment */) { + else if (p.kind === 283 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -31725,7 +31745,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 196 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 195 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31787,7 +31807,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -31826,14 +31846,14 @@ var ts; } function bindJSDocTypeAlias(node) { node.tagName.parent = node; - if (node.kind !== 317 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 316 /* JSDocEnumTag */ && node.fullName) { setParentPointers(node, node.fullName); } } function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 162 /* MethodDeclaration */) { + if (host && host.kind !== 161 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -31845,15 +31865,17 @@ var ts; } } function bindOptionalChainRest(node) { - bind(node.questionDotToken); switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: + bind(node.questionDotToken); bind(node.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: + bind(node.questionDotToken); bind(node.argumentExpression); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: + bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); break; @@ -31871,7 +31893,7 @@ var ts; // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest // of the node as part of the "true" branch, and continue to do so as we ascend back up to the outermost // chain node. We then treat the entire node as the right side of the expression. - var preChainLabel = node.questionDotToken ? createBranchLabel() : undefined; + var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined; bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); if (preChainLabel) { currentFlow = finishFlowLabel(preChainLabel); @@ -31892,6 +31914,14 @@ var ts; bindOptionalChain(node, currentTrueTarget, currentFalseTarget); } } + function bindNonNullExpressionFlow(node) { + if (ts.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } + else { + bindEachChild(node); + } + } function bindAccessExpressionFlow(node) { if (ts.isOptionalChain(node)) { bindOptionalChainFlow(node); @@ -31909,7 +31939,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 202 /* FunctionExpression */ || expr.kind === 203 /* ArrowFunction */) { + if (expr.kind === 201 /* FunctionExpression */ || expr.kind === 202 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -31918,7 +31948,7 @@ var ts; bindEachChild(node); } } - if (node.expression.kind === 195 /* PropertyAccessExpression */) { + if (node.expression.kind === 194 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -31927,54 +31957,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 194 /* ObjectLiteralExpression */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 275 /* JsxAttributes */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 193 /* ObjectLiteralExpression */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 274 /* JsxAttributes */: return 1 /* IsContainer */; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 163 /* Constructor */: - case 245 /* FunctionDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 166 /* CallSignature */: - case 306 /* JSDocSignature */: - case 301 /* JSDocFunctionType */: - case 171 /* FunctionType */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 172 /* ConstructorType */: + case 162 /* Constructor */: + case 244 /* FunctionDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 165 /* CallSignature */: + case 305 /* JSDocSignature */: + case 300 /* JSDocFunctionType */: + case 170 /* FunctionType */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 171 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 281 /* CatchClause */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: - case 252 /* CaseBlock */: + case 280 /* CatchClause */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: + case 251 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 224 /* Block */: + case 223 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -32007,45 +32037,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 291 /* SourceFile */: + case 290 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 194 /* ObjectLiteralExpression */: - case 247 /* InterfaceDeclaration */: - case 275 /* JsxAttributes */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 193 /* ObjectLiteralExpression */: + case 246 /* InterfaceDeclaration */: + case 274 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 306 /* JSDocSignature */: - case 168 /* IndexSignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 301 /* JSDocFunctionType */: - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 248 /* TypeAliasDeclaration */: - case 187 /* MappedType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 305 /* JSDocSignature */: + case 167 /* IndexSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 300 /* JSDocFunctionType */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 247 /* TypeAliasDeclaration */: + case 186 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -32146,7 +32176,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { + if (prop.kind === 283 /* SpreadAssignment */ || prop.name.kind !== 75 /* Identifier */) { continue; } var identifier = prop.name; @@ -32158,7 +32188,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 282 /* PropertyAssignment */ || prop.kind === 283 /* ShorthandPropertyAssignment */ || prop.kind === 162 /* MethodDeclaration */ + var currentKind = prop.kind === 281 /* PropertyAssignment */ || prop.kind === 282 /* ShorthandPropertyAssignment */ || prop.kind === 161 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -32190,10 +32220,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -32379,8 +32409,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 291 /* SourceFile */ && - blockScopeContainer.kind !== 250 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 290 /* SourceFile */ && + blockScopeContainer.kind !== 249 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -32475,7 +32505,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 153 /* LastToken */) { + if (node.kind > 152 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -32551,14 +32581,14 @@ var ts; } // falls through case 104 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 283 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 282 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); case 76 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -32573,7 +32603,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -32601,78 +32631,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return checkStrictModeCatchClause(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkStrictModeWithStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 184 /* ThisType */: + case 183 /* ThisType */: seenThisKeyword = true; return; - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: break; // Binding the children will handle everything - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return bindTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return bindParameter(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return bindPropertyWorker(node); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 285 /* EnumMember */: + case 284 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 171 /* FunctionType */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: + case 171 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 187 /* MappedType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 186 /* MappedType */: return bindAnonymousTypeWorker(node); - case 311 /* JSDocClassTag */: + case 310 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return bindFunctionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -32691,65 +32721,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return bindJsxAttributes(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return bindImportClause(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return bindExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return bindExportAssignment(node); - case 291 /* SourceFile */: + case 290 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 224 /* Block */: + case 223 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 318 /* JSDocParameterTag */: - if (node.parent.kind === 306 /* JSDocSignature */) { + case 317 /* JSDocParameterTag */: + if (node.parent.kind === 305 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 305 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 304 /* JSDocTypeLiteral */) { break; } // falls through - case 324 /* JSDocPropertyTag */: + case 323 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 300 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 299 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -32905,8 +32935,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -32928,11 +32958,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -32944,7 +32974,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -32974,7 +33004,7 @@ var ts; if (node.expression.kind === 104 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 291 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 290 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -33014,7 +33044,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 291 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 290 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -33116,8 +33146,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 291 /* SourceFile */ - : propertyAccess.parent.parent.kind === 291 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 290 /* SourceFile */ + : propertyAccess.parent.parent.kind === 290 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); @@ -33196,7 +33226,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 246 /* ClassDeclaration */) { + if (node.kind === 245 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -33259,7 +33289,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 318 /* JSDocParameterTag */ && container.kind !== 306 /* JSDocSignature */) { + if (node.kind === 317 /* JSDocParameterTag */ && container.kind !== 305 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -33336,7 +33366,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 182 /* InferType */) { + else if (node.parent.kind === 181 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -33364,11 +33394,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 225 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 224 /* EmptyStatement */) || // report error on class declarations - node.kind === 246 /* ClassDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 250 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 249 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -33412,12 +33442,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; @@ -33466,58 +33496,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 157 /* Parameter */: + case 156 /* Parameter */: return computeParameter(node, subtreeFlags); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 163 /* Constructor */: + case 162 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -33568,12 +33598,12 @@ var ts; if (operatorTokenKind === 60 /* QuestionQuestionToken */) { transformFlags |= 8 /* AssertES2020 */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 194 /* ObjectLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 193 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 62 /* EqualsToken */ && leftKind === 192 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 256 /* AssertES2015 */ | 1024 /* AssertDestructuringAssignment */; } @@ -33621,8 +33651,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 218 /* AsExpression */ - || expressionKind === 200 /* TypeAssertionExpression */) { + if (expressionKind === 217 /* AsExpression */ + || expressionKind === 199 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -33970,13 +34000,13 @@ var ts; // async is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */; break; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: // await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 32 /* AssertES2018 */ | 64 /* AssertES2017 */ | 524288 /* ContainsAwait */; break; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; @@ -33985,27 +34015,27 @@ var ts; case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: case 81 /* ConstKeyword */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: - case 219 /* NonNullExpression */: - case 139 /* ReadonlyKeyword */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: + case 218 /* NonNullExpression */: + case 138 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: case 11 /* JsxText */: - case 270 /* JsxClosingElement */: - case 271 /* JsxFragment */: - case 272 /* JsxOpeningFragment */: - case 273 /* JsxClosingFragment */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 277 /* JsxExpression */: + case 269 /* JsxClosingElement */: + case 270 /* JsxFragment */: + case 271 /* JsxOpeningFragment */: + case 272 /* JsxClosingFragment */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 276 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -34018,16 +34048,16 @@ var ts; break; } // falls through - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: if (ts.hasInvalidEscape(node.template)) { transformFlags |= 32 /* AssertES2018 */; break; } // falls through - case 212 /* TemplateExpression */: - case 283 /* ShorthandPropertyAssignment */: + case 211 /* TemplateExpression */: + case 282 /* ShorthandPropertyAssignment */: case 120 /* StaticKeyword */: - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 256 /* AssertES2015 */; break; @@ -34044,70 +34074,70 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 32 /* AssertES2018 */; } transformFlags |= 256 /* AssertES2015 */; break; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 32 /* AssertES2018 */ | 256 /* AssertES2015 */ | 262144 /* ContainsYield */; break; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 142 /* ObjectKeyword */: - case 144 /* StringKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 141 /* ObjectKeyword */: + case 143 /* StringKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 169 /* TypePredicate */: - case 170 /* TypeReference */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 173 /* TypeQuery */: - case 174 /* TypeLiteral */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 182 /* InferType */: - case 183 /* ParenthesizedType */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: - case 253 /* NamespaceExportDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 168 /* TypePredicate */: + case 169 /* TypeReference */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 172 /* TypeQuery */: + case 173 /* TypeLiteral */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 181 /* InferType */: + case 182 /* ParenthesizedType */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: + case 252 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 32768 /* ContainsComputedPropertyName */; break; - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: transformFlags |= 256 /* AssertES2015 */ | 8192 /* ContainsRestOrSpread */; break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; break; case 102 /* SuperKeyword */: @@ -34119,28 +34149,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 4096 /* ContainsLexicalThis */; break; - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; if (subtreeFlags & 8192 /* ContainsRestOrSpread */) { transformFlags |= 32 /* AssertES2018 */ | 16384 /* ContainsObjectRestOrSpread */; } excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: transformFlags |= 256 /* AssertES2015 */ | 131072 /* ContainsBindingPattern */; excludeFlags = 536879104 /* BindingPatternExcludes */; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: transformFlags |= 256 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 8192 /* ContainsRestOrSpread */; } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 2048 /* ContainsTypeScriptClassSyntax */; break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: excludeFlags = 536922112 /* ObjectLiteralExcludes */; if (subtreeFlags & 32768 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -34153,29 +34183,29 @@ var ts; transformFlags |= 32 /* AssertES2018 */; } break; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: excludeFlags = 536879104 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 65536 /* ContainsBlockScopedBinding */) { transformFlags |= 256 /* AssertES2015 */; } break; - case 291 /* SourceFile */: + case 290 /* SourceFile */: break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: transformFlags |= 4 /* AssertESNext */; break; - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */ | 32 /* AssertES2018 */; break; - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: transformFlags |= 1048576 /* ContainsHoistedDeclarationOrCompletion */; break; case 76 /* PrivateIdentifier */: @@ -34196,67 +34226,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 169 /* FirstTypeNode */ && kind <= 189 /* LastTypeNode */) { + if (kind >= 168 /* FirstTypeNode */ && kind <= 188 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 193 /* ArrayLiteralExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 192 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return 537991168 /* ModuleExcludes */; - case 157 /* Parameter */: + case 156 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return 538920960 /* ArrowFunctionExcludes */; - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: return 538925056 /* FunctionExcludes */; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 163 /* Constructor */: + case 162 /* Constructor */: return 538923008 /* ConstructorExcludes */; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 125 /* AnyKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 138 /* NeverKeyword */: - case 144 /* StringKeyword */: - case 142 /* ObjectKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 137 /* NeverKeyword */: + case 143 /* StringKeyword */: + case 141 /* ObjectKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: case 110 /* VoidKeyword */: - case 156 /* TypeParameter */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 155 /* TypeParameter */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 281 /* CatchClause */: + case 280 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 327 /* PartiallyEmittedExpression */: - case 201 /* ParenthesizedExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + case 326 /* PartiallyEmittedExpression */: + case 200 /* ParenthesizedExpression */: case 102 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -34431,7 +34461,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 173 /* TypeQuery */) { + if (d.type && d.type.kind === 172 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35073,7 +35103,6 @@ var ts; var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); var substitutionTypes = ts.createMap(); - var awaitedTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -35639,7 +35668,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 291 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 290 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -35697,17 +35726,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 192 /* BindingElement */) { + if (declaration.kind === 191 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 192 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 191 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 243 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 242 /* VariableDeclaration */), usage); } - else if (declaration.kind === 243 /* VariableDeclaration */) { + else if (declaration.kind === 242 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -35738,12 +35767,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 264 /* ExportSpecifier */ || (usage.parent.kind === 260 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 263 /* ExportSpecifier */ || (usage.parent.kind === 259 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 260 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 259 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -35763,9 +35792,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 226 /* VariableStatement */: - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: + case 225 /* VariableStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -35786,16 +35815,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 160 /* PropertyDeclaration */ && + current.parent.kind === 159 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 162 /* MethodDeclaration */) { + if (declaration.kind === 161 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -35817,19 +35846,19 @@ var ts; return "quit"; } switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return true; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 224 /* Block */: + case 223 /* Block */: switch (node.parent.kind) { - case 164 /* GetAccessor */: - case 162 /* MethodDeclaration */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 161 /* MethodDeclaration */: + case 164 /* SetAccessor */: return true; default: return false; @@ -35875,12 +35904,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 304 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 303 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 157 /* Parameter */ || - lastLocation.kind === 156 /* TypeParameter */ + lastLocation.kind === 156 /* Parameter */ || + lastLocation.kind === 155 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -35897,13 +35926,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 157 /* Parameter */ || + lastLocation.kind === 156 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 181 /* ConditionalType */) { + else if (location.kind === 180 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -35918,14 +35947,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 291 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 290 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -35949,7 +35978,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 264 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 263 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 263 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 262 /* NamespaceExport */))) { break; } } @@ -35963,12 +35992,12 @@ var ts; } } break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -35985,9 +36014,9 @@ var ts; } } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -36006,7 +36035,7 @@ var ts; } break loop; } - if (location.kind === 215 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 214 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36014,7 +36043,7 @@ var ts; } } break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 90 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -36034,9 +36063,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 247 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 246 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -36044,24 +36073,24 @@ var ts; } } break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 245 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 244 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -36074,7 +36103,7 @@ var ts; } } break; - case 158 /* Decorator */: + case 157 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -36083,7 +36112,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 157 /* Parameter */) { + if (location.parent && location.parent.kind === 156 /* Parameter */) { location = location.parent; } // @@ -36098,25 +36127,25 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 246 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 245 /* ClassDeclaration */)) { location = location.parent; } break; - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 157 /* Parameter */: + case 156 /* Parameter */: if (lastLocation && lastLocation === location.initializer) { associatedDeclarationForContainingInitializer = location; } break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: if (lastLocation && lastLocation === location.initializer) { var root = ts.getRootDeclaration(location); - if (root.kind === 157 /* Parameter */) { + if (root.kind === 156 /* Parameter */) { associatedDeclarationForContainingInitializer = location; } } @@ -36136,7 +36165,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 291 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 290 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36253,10 +36282,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 203 /* ArrowFunction */ && location.kind !== 202 /* FunctionExpression */) { + if (location.kind !== 202 /* ArrowFunction */ && location.kind !== 201 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 160 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -36269,12 +36298,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 250 /* ModuleDeclaration */: // For `namespace N { N; }` + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 249 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -36286,7 +36315,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 156 /* TypeParameter */) { + if (decl.kind === 155 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -36342,9 +36371,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 75 /* Identifier */: - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36388,7 +36417,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 264 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 263 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36447,7 +36476,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 249 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 248 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -36482,13 +36511,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return node; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.parent; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return node.parent.parent; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -36512,28 +36541,28 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 253 /* NamespaceExportDeclaration */ || - node.kind === 256 /* ImportClause */ && !!node.name || - node.kind === 257 /* NamespaceImport */ || - node.kind === 263 /* NamespaceExport */ || - node.kind === 259 /* ImportSpecifier */ || - node.kind === 264 /* ExportSpecifier */ || - node.kind === 260 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + return node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 252 /* NamespaceExportDeclaration */ || + node.kind === 255 /* ImportClause */ && !!node.name || + node.kind === 256 /* NamespaceImport */ || + node.kind === 262 /* NamespaceExport */ || + node.kind === 258 /* ImportSpecifier */ || + node.kind === 263 /* ExportSpecifier */ || + node.kind === 259 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || - node.kind === 283 /* ShorthandPropertyAssignment */ || - node.kind === 282 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); + node.kind === 282 /* ShorthandPropertyAssignment */ || + node.kind === 281 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); @@ -36834,28 +36863,28 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 260 /* ExportAssignment */: - case 210 /* BinaryExpression */: + case 259 /* ExportAssignment */: + case 209 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -37007,13 +37036,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 154 /* QualifiedName */) { + if (entityName.kind === 75 /* Identifier */ || entityName.parent.kind === 153 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 254 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 253 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -37037,9 +37066,9 @@ var ts; return symbolFromJSPrototype; } } - else if (name.kind === 154 /* QualifiedName */ || name.kind === 195 /* PropertyAccessExpression */) { - var left = name.kind === 154 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 154 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 153 /* QualifiedName */ || name.kind === 194 /* PropertyAccessExpression */) { + var left = name.kind === 153 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 153 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37074,7 +37103,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 260 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 259 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37296,7 +37325,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 291 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 290 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -37583,7 +37612,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 163 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 162 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -37670,12 +37699,12 @@ var ts; } } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -37684,9 +37713,9 @@ var ts; return { value: result }; } break; - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -37769,7 +37798,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -37813,7 +37842,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 264 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 263 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -37828,10 +37857,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: continue; default: return false; @@ -37962,10 +37991,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38012,14 +38041,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 173 /* TypeQuery */ || + if (entityName.parent.kind === 172 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 155 /* ComputedPropertyName */) { + entityName.parent.kind === 154 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 154 /* QualifiedName */ || entityName.kind === 195 /* PropertyAccessExpression */ || - entityName.parent.kind === 254 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 153 /* QualifiedName */ || entityName.kind === 194 /* PropertyAccessExpression */ || + entityName.parent.kind === 253 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -38068,10 +38097,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 172 /* ConstructorType */ : 171 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 171 /* ConstructorType */ : 170 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructSignature */ : 166 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructSignature */ : 165 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38191,23 +38220,23 @@ var ts; return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(144 /* StringKeyword */); + return ts.createKeywordTypeNode(143 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(141 /* NumberKeyword */); + return ts.createKeywordTypeNode(140 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(152 /* BigIntKeyword */); + return ts.createKeywordTypeNode(151 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(129 /* BooleanKeyword */); + return ts.createKeywordTypeNode(128 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -38248,7 +38277,7 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(148 /* UniqueKeyword */, ts.createKeywordTypeNode(145 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(147 /* UniqueKeyword */, ts.createKeywordTypeNode(144 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -38256,7 +38285,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(147 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(146 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -38264,15 +38293,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(138 /* NeverKeyword */); + return ts.createKeywordTypeNode(137 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(145 /* SymbolKeyword */); + return ts.createKeywordTypeNode(144 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(142 /* ObjectKeyword */); + return ts.createKeywordTypeNode(141 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -38321,7 +38350,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 179 /* UnionType */ : 180 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 178 /* UnionType */ : 179 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -38348,11 +38377,6 @@ var ts; context.approximateLength += 2; return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } - if (type.flags & 134217728 /* Awaited */) { - var awaitedTypeNode = typeToTypeNodeHelper(type.awaitedType, context); - context.approximateLength += 9; - return ts.createTypeOperatorNode(128 /* AwaitedKeyword */, awaitedTypeNode); - } if (type.flags & 16777216 /* Conditional */) { var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); var saveInferTypeParameters = context.inferTypeParameters; @@ -38397,7 +38421,7 @@ var ts; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 215 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 214 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 111551 /* Value */); @@ -38427,7 +38451,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 291 /* SourceFile */ || declaration.parent.kind === 251 /* ModuleBlock */; + return declaration.parent.kind === 290 /* SourceFile */ || declaration.parent.kind === 250 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -38478,12 +38502,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 170 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 172 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 171 /* ConstructorType */, context); return signatureNode; } } @@ -38504,7 +38528,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -38518,12 +38542,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(139 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(138 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -38618,11 +38642,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 165 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 167 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 166 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -38699,7 +38723,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 161 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 160 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(preserveCommentsOn(methodDeclaration)); @@ -38716,7 +38740,7 @@ var ts; propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -38725,8 +38749,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 324 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 323 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -38777,7 +38801,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 144 /* StringKeyword */ : 141 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 143 /* StringKeyword */ : 140 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -38790,7 +38814,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(139 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(138 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var suppressAny = context.flags & 256 /* SuppressAnyReturnType */; @@ -38804,7 +38828,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 163 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 162 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -38848,9 +38872,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 157 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 156 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 318 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 317 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -38862,7 +38886,7 @@ var ts; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 75 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 154 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 153 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -38881,7 +38905,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 192 /* BindingElement */) { + if (clone.kind === 191 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -39022,7 +39046,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 291 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 290 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -39328,8 +39352,8 @@ var ts; return initial; } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 162 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 161 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.createProperty, 161 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type, initializer) { return ts.createPropertySignature(mods, name, question, type, initializer); }, 160 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -39668,8 +39692,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 166 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 167 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 165 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 166 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.createHeritageClause(90 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b); }))]; addResult(ts.createInterfaceDeclaration( @@ -39784,7 +39808,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 245 /* FunctionDeclaration */, context); + var decl = signatureToSignatureDeclarationHelper(sig, 244 /* FunctionDeclaration */, context); decl.name = ts.createIdentifier(localName); addResult(ts.setTextRange(decl, sig.declaration), modifierFlags); } @@ -39877,7 +39901,7 @@ var ts; var staticMembers = symbol.flags & (16 /* Function */ | 512 /* ValueModule */) ? [] : ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== "prototype"; }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); }); - var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 163 /* Constructor */); + var constructors = serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 162 /* Constructor */); for (var _i = 0, constructors_1 = constructors; _i < constructors_1.length; _i++) { var c = constructors_1[_i]; // A constructor's return type and type parameters are supposed to be controlled by the enclosing class declaration @@ -39909,7 +39933,7 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` var isLocalImport = !(target.flags & 512 /* ValueModule */); @@ -39919,13 +39943,13 @@ var ts; ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) : ts.createExternalModuleReference(ts.createLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(ts.createIdentifier(localName), /*namedBindings*/ undefined), @@ -39934,24 +39958,24 @@ var ts; // In such cases, the `target` refers to the module itself already ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamespaceImport(ts.createIdentifier(localName))), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: addResult(ts.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamespaceExport(ts.createIdentifier(localName)), ts.createLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: addResult(ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*importClause*/ undefined, ts.createNamedImports([ ts.createImportSpecifier(localName !== verbatimTargetName ? ts.createIdentifier(verbatimTargetName) : undefined, ts.createIdentifier(localName)) ])), ts.createLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -39959,11 +39983,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.createLiteral(specifier.text) : undefined); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 210 /* BinaryExpression */: - case 195 /* PropertyAccessExpression */: + case 209 /* BinaryExpression */: + case 194 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -40184,17 +40208,17 @@ var ts; return result; function visitExistingNodeTreeSymbols(node) { // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 303 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 302 /* JSDocNamepathType */) { return ts.createKeywordTypeNode(125 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.createKeywordTypeNode(149 /* UnknownKeyword */); + return ts.createKeywordTypeNode(148 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(100 /* NullKeyword */)]); } if (ts.isJSDocOptionalType(node)) { - return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(147 /* UndefinedKeyword */)]); + return ts.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.createKeywordTypeNode(146 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -40463,8 +40487,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 183 /* ParenthesizedType */; }); - if (node.kind === 248 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 182 /* ParenthesizedType */; }); + if (node.kind === 247 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -40472,11 +40496,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 251 /* ModuleBlock */ && + node.parent.kind === 250 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 291 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 290 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40535,17 +40559,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 243 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 242 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 215 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 214 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40562,28 +40586,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 316 /* JSDocCallbackTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 245 /* FunctionDeclaration */: - case 249 /* EnumDeclaration */: - case 254 /* ImportEqualsDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 244 /* FunctionDeclaration */: + case 248 /* EnumDeclaration */: + case 253 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -40591,54 +40615,54 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 254 /* ImportEqualsDeclaration */ && parent.kind !== 291 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 253 /* ImportEqualsDeclaration */ && parent.kind !== 290 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 163 /* Constructor */: - case 167 /* ConstructSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 157 /* Parameter */: - case 251 /* ModuleBlock */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 170 /* TypeReference */: - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 183 /* ParenthesizedType */: + case 162 /* Constructor */: + case 166 /* ConstructSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 156 /* Parameter */: + case 250 /* ModuleBlock */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 169 /* TypeReference */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 182 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: return false; // Type parameters are always visible - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 291 /* SourceFile */: - case 253 /* NamespaceExportDeclaration */: + case 290 /* SourceFile */: + case 252 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return false; default: return false; @@ -40647,10 +40671,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 260 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 259 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 264 /* ExportSpecifier */) { + else if (node.parent.kind === 263 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -40753,12 +40777,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 243 /* VariableDeclaration */: - case 244 /* VariableDeclarationList */: - case 259 /* ImportSpecifier */: - case 258 /* NamedImports */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 242 /* VariableDeclaration */: + case 243 /* VariableDeclarationList */: + case 258 /* ImportSpecifier */: + case 257 /* NamedImports */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: return false; default: return true; @@ -40791,7 +40815,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 155 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 154 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -40845,7 +40869,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(196 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(195 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -40860,23 +40884,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 192 /* BindingElement */: - case 282 /* PropertyAssignment */: + case 191 /* BindingElement */: + case 281 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ancestor.initializer; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 192 /* BindingElement */ && parent.kind === 190 /* ObjectBindingPattern */) { + if (node.kind === 191 /* BindingElement */ && parent.kind === 189 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 282 /* PropertyAssignment */ || node.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.kind === 281 /* PropertyAssignment */ || node.kind === 282 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -40902,7 +40926,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 190 /* ObjectBindingPattern */) { + if (pattern.kind === 189 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -40975,7 +40999,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 193 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 192 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -40985,11 +41009,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 231 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -41008,7 +41032,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 243 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 242 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -41022,11 +41046,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 157 /* Parameter */) { + if (declaration.kind === 156 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 165 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 164 /* GetAccessor */); + if (func.kind === 164 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 163 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41241,9 +41265,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 163 /* Constructor */ || - thisContainer.kind === 245 /* FunctionDeclaration */ || - (thisContainer.kind === 202 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 162 /* Constructor */ || + thisContainer.kind === 244 /* FunctionDeclaration */ || + (thisContainer.kind === 201 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41327,7 +41351,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 192 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 191 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -41351,7 +41375,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 190 /* ObjectBindingPattern */ + return pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41390,7 +41414,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 157 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 156 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41448,7 +41472,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 260 /* ExportAssignment */) { + if (declaration.kind === 259 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41519,7 +41543,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 164 /* GetAccessor */) { + if (accessor.kind === 163 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41553,15 +41577,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); error(getter, 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)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 164 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 165 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 163 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 164 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41629,9 +41653,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 210 /* BinaryExpression */ || + else if (declaration.kind === 209 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 210 /* BinaryExpression */) { + declaration.parent.kind === 209 /* BinaryExpression */) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -41698,7 +41722,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 157 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 156 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -41797,36 +41821,36 @@ var ts; return undefined; } switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 247 /* InterfaceDeclaration */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 161 /* MethodSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 301 /* JSDocFunctionType */: - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 248 /* TypeAliasDeclaration */: - case 322 /* JSDocTemplateTag */: - case 323 /* JSDocTypedefTag */: - case 317 /* JSDocEnumTag */: - case 316 /* JSDocCallbackTag */: - case 187 /* MappedType */: - case 181 /* ConditionalType */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 246 /* InterfaceDeclaration */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 160 /* MethodSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 300 /* JSDocFunctionType */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 247 /* TypeAliasDeclaration */: + case 321 /* JSDocTemplateTag */: + case 322 /* JSDocTypedefTag */: + case 316 /* JSDocEnumTag */: + case 315 /* JSDocCallbackTag */: + case 186 /* MappedType */: + case 180 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 187 /* MappedType */) { + if (node.kind === 186 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 181 /* ConditionalType */) { + else if (node.kind === 180 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */ || node.kind === 247 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */ || node.kind === 246 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -41834,7 +41858,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -41844,9 +41868,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 246 /* ClassDeclaration */ || - node.kind === 215 /* ClassExpression */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 245 /* ClassDeclaration */ || + node.kind === 214 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42064,7 +42088,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 246 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42100,7 +42124,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 247 /* InterfaceDeclaration */) { + if (declaration.kind === 246 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -42188,7 +42212,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 210 /* BinaryExpression */) { + else if (expr.kind === 209 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42203,12 +42227,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 75 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -42222,7 +42246,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42249,7 +42273,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 249 /* EnumDeclaration */) { + if (declaration.kind === 248 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42322,22 +42346,22 @@ var ts; function isThislessType(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 152 /* BigIntKeyword */: - case 129 /* BooleanKeyword */: - case 145 /* SymbolKeyword */: - case 142 /* ObjectKeyword */: + case 148 /* UnknownKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 151 /* BigIntKeyword */: + case 128 /* BooleanKeyword */: + case 144 /* SymbolKeyword */: + case 141 /* ObjectKeyword */: case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: - case 188 /* LiteralType */: + case 137 /* NeverKeyword */: + case 187 /* LiteralType */: return true; - case 175 /* ArrayType */: + case 174 /* ArrayType */: return isThislessType(node.elementType); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42363,7 +42387,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 163 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 162 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42379,14 +42403,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -43302,8 +43326,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 185 /* TypeOperator */ && - constraintDeclaration.operator === 135 /* KeyOfKeyword */; + return constraintDeclaration.kind === 184 /* TypeOperator */ && + constraintDeclaration.operator === 134 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43528,7 +43552,7 @@ var ts; var hasDisjointDomainType = false; for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { var t = types_4[_i]; - if (t.flags & 197394432 /* Instantiable */) { + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -43564,7 +43588,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (193200128 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43666,10 +43690,6 @@ var ts; constraintDepth--; return result; } - if (t.flags & 134217728 /* Awaited */) { - var basePromiseType = getBaseConstraint(t.awaitedType); - return basePromiseType ? getAwaitedType(basePromiseType) : undefined; - } if (t.flags & 33554432 /* Substitution */) { return getBaseConstraint(t.substitute); } @@ -43741,7 +43761,7 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 197394432 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 132 /* StringLike */ ? globalStringType : @@ -44029,10 +44049,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 300 /* JSDocOptionalType */ + node.type && node.type.kind === 299 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44066,7 +44086,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 300 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 299 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44148,7 +44168,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 188 /* LiteralType */) { + if (type && type.kind === 187 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -44161,16 +44181,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 164 /* GetAccessor */ || declaration.kind === 165 /* SetAccessor */) && + if ((declaration.kind === 163 /* GetAccessor */ || declaration.kind === 164 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = declaration.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 163 /* Constructor */ ? + var classType = declaration.kind === 162 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44235,11 +44255,11 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - return node.name.kind === 155 /* ComputedPropertyName */ + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + return node.name.kind === 154 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44311,7 +44331,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 184 /* ThisType */ ? + return parameterName.kind === 183 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44354,7 +44374,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 163 /* Constructor */) { + if (declaration.kind === 162 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44364,12 +44384,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 164 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 163 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 165 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 164 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44459,7 +44479,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 163 /* Constructor */ || kind === 167 /* ConstructSignature */ || kind === 172 /* ConstructorType */; + var isConstructor = kind === 162 /* Constructor */ || kind === 166 /* ConstructSignature */ || kind === 171 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44473,7 +44493,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 141 /* NumberKeyword */ : 144 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 140 /* NumberKeyword */ : 143 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44507,13 +44527,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 182 /* InferType */) { + if (declaration.parent.kind === 181 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. var grandParent = declaration.parent.parent; - if (grandParent.kind === 170 /* TypeReference */) { + if (grandParent.kind === 169 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -44538,7 +44558,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 157 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 156 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -44563,7 +44583,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 187 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 186 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44572,7 +44592,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 156 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 155 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44652,8 +44672,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 170 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 169 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44697,7 +44717,7 @@ var ts; return errorType; } } - if (node.kind === 170 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 169 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -44742,9 +44762,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -44811,7 +44831,7 @@ var ts; } isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; } - var isImportTypeWithQualifier = node.kind === 189 /* ImportType */ && node.qualifier; + var isImportTypeWithQualifier = node.kind === 188 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); @@ -44837,7 +44857,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 176 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 175 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -44846,9 +44866,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 304 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 303 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 181 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 180 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -44859,7 +44879,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 170 /* TypeReference */ || node.kind === 189 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 169 /* TypeReference */ || node.kind === 188 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -44972,9 +44992,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 249 /* EnumDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 248 /* EnumDeclaration */: return declaration; } } @@ -45095,19 +45115,19 @@ var ts; } function getArrayOrTupleTargetType(node) { var readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === 175 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 178 /* RestType */) { + if (node.kind === 174 /* ArrayType */ || node.elementTypes.length === 1 && node.elementTypes[0].kind === 177 /* RestType */) { return readonly ? globalReadonlyArrayType : globalArrayType; } var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement = lastElement && lastElement.kind === 178 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 177 /* OptionalType */ && n !== restElement; }) + 1; + var restElement = lastElement && lastElement.kind === 177 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 176 /* OptionalType */ && n !== restElement; }) + 1; return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 175 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 176 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 174 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 175 /* TupleType */ ? ts.some(node.elementTypes, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -45116,15 +45136,15 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 183 /* ParenthesizedType */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 186 /* IndexedAccessType */: - case 181 /* ConditionalType */: - case 185 /* TypeOperator */: + case 182 /* ParenthesizedType */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 185 /* IndexedAccessType */: + case 180 /* ConditionalType */: + case 184 /* TypeOperator */: return isResolvedByTypeAlias(parent); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return true; } return false; @@ -45133,27 +45153,27 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 170 /* TypeReference */: + case 169 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; - case 185 /* TypeOperator */: - return node.operator !== 148 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 300 /* JSDocOptionalType */: - case 298 /* JSDocNullableType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 184 /* TypeOperator */: + return node.operator !== 147 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 299 /* JSDocOptionalType */: + case 297 /* JSDocNullableType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 178 /* RestType */: - return node.type.kind !== 175 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 177 /* RestType */: + return node.type.kind !== 174 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 178 /* UnionType */: + case 179 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45167,18 +45187,18 @@ var ts; links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 176 /* TupleType */ && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === 175 /* TupleType */ && node.elementTypes.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 175 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); + var elementTypes = node.kind === 174 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elementTypes, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 139 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 138 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -45283,7 +45303,7 @@ var ts; // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { includes |= flags & 71041023 /* IncludesMask */; - if (flags & 201064448 /* StructuredOrInstantiable */) + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -45415,7 +45435,7 @@ var ts; neverType; } } - var objectFlags = (includes & 201211939 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45769,7 +45789,7 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - maybeTypeOfKind(type, 193200128 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : + maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : @@ -45791,24 +45811,20 @@ var ts; return indexType.flags & 131072 /* Never */ ? stringType : indexType; } function getTypeFromTypeOperatorNode(node) { - var _a; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 135 /* KeyOfKeyword */: + case 134 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 148 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 145 /* SymbolKeyword */ + case 147 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 144 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; - case 128 /* AwaitedKeyword */: - links.resolvedType = (_a = getAwaitedType(getTypeFromTypeNode(node.type))) !== null && _a !== void 0 ? _a : unknownType; - break; default: throw ts.Debug.assertNever(node.operator); } @@ -45843,13 +45859,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -45860,7 +45876,7 @@ var ts; undefined; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { - var accessExpression = accessNode && accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); @@ -45997,9 +46013,9 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 196 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 186 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 155 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 195 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 185 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 154 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isGenericObjectType(type) { @@ -46010,7 +46026,7 @@ var ts; } return !!(type.objectFlags & 8388608 /* IsGenericObjectType */); } - return !!(type.flags & 193200128 /* InstantiableNonPrimitive */) || isGenericMappedType(type); + return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type); } function isGenericIndexType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { @@ -46020,7 +46036,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (193200128 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -46073,7 +46089,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 197394432 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -46145,7 +46161,7 @@ var ts; // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 186 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 185 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -46458,7 +46474,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 139 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 138 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46705,7 +46721,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 247 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 246 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46741,88 +46757,88 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 125 /* AnyKeyword */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: return anyType; - case 149 /* UnknownKeyword */: + case 148 /* UnknownKeyword */: return unknownType; - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return stringType; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return numberType; - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return bigintType; - case 129 /* BooleanKeyword */: + case 128 /* BooleanKeyword */: return booleanType; - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return esSymbolType; case 110 /* VoidKeyword */: return voidType; - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return undefinedType; case 100 /* NullKeyword */: return nullType; - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return neverType; - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 184 /* ThisType */: + case 183 /* ThisType */: case 104 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return getTypeFromTypeReference(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 183 /* ParenthesizedType */: - case 299 /* JSDocNonNullableType */: - case 295 /* JSDocTypeExpression */: + case 182 /* ParenthesizedType */: + case 298 /* JSDocNonNullableType */: + case 294 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 178 /* RestType */: + case 177 /* RestType */: return getElementTypeOfArrayType(getTypeFromTypeNode(node.type)) || errorType; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 174 /* TypeLiteral */: - case 305 /* JSDocTypeLiteral */: - case 301 /* JSDocFunctionType */: - case 306 /* JSDocSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 173 /* TypeLiteral */: + case 304 /* JSDocTypeLiteral */: + case 300 /* JSDocFunctionType */: + case 305 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 182 /* InferType */: + case 181 /* InferType */: return getTypeFromInferTypeNode(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 75 /* Identifier */: - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47030,9 +47046,9 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 154 /* QualifiedName */ || - node.parent.kind === 170 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 189 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 153 /* QualifiedName */ || + node.parent.kind === 169 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 188 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -47041,7 +47057,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 224 /* Block */ || n.kind === 181 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 223 /* Block */ || n.kind === 180 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47050,12 +47066,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 184 /* ThisType */: + case 183 /* ThisType */: return !!tp.isThisType; case 75 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -47087,7 +47103,7 @@ var ts; var mappedTypeVariable = instantiateType(typeVariable, mapper); if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { - if (t.flags & (3 /* AnyOrUnknown */ | 193200128 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { + if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { var replacementMapper = prependTypeMapping(typeVariable, t, mapper); return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : @@ -47205,7 +47221,6 @@ var ts; return result; } function instantiateTypeWorker(type, mapper) { - var _a; var flags = type.flags; if (flags & 262144 /* TypeParameter */) { return getMappedType(type, mapper); @@ -47253,9 +47268,6 @@ var ts; if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); } - if (flags & 134217728 /* Awaited */) { - return (_a = getAwaitedType(instantiateType(type.awaitedType, mapper))) !== null && _a !== void 0 ? _a : unknownType; - } if (flags & 33554432 /* Substitution */) { var maybeVariable = instantiateType(type.baseType, mapper); if (maybeVariable.flags & 8650752 /* TypeVariable */) { @@ -47297,35 +47309,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 274 /* JsxAttribute */: { + case 273 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 277 /* JsxExpression */: { + case 276 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g
) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -47344,7 +47356,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 203 /* ArrowFunction */) { + if (node.kind !== 202 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -47357,7 +47369,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 224 /* Block */ && isContextSensitive(node.body); + return !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 223 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47410,7 +47422,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 193200128 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : + source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)); @@ -47460,23 +47472,23 @@ var ts; return true; } switch (node.kind) { - case 277 /* JsxExpression */: - case 201 /* ParenthesizedExpression */: + case 276 /* JsxExpression */: + case 200 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47667,7 +47679,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -47676,9 +47688,9 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 267 /* JsxElement */: - case 268 /* JsxSelfClosingElement */: - case 271 /* JsxFragment */: + case 266 /* JsxElement */: + case 267 /* JsxSelfClosingElement */: + case 270 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: @@ -47829,11 +47841,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 165 /* SetAccessor */: return [3 /*break*/, 2]; - case 164 /* GetAccessor */: return [3 /*break*/, 2]; - case 162 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 283 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 282 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 164 /* SetAccessor */: return [3 /*break*/, 2]; + case 163 /* GetAccessor */: return [3 /*break*/, 2]; + case 161 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 282 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 281 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -47910,8 +47922,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 162 /* MethodDeclaration */ && - kind !== 161 /* MethodSignature */ && kind !== 163 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 161 /* MethodDeclaration */ && + kind !== 160 /* MethodSignature */ && kind !== 162 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48172,7 +48184,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -48582,7 +48594,7 @@ var ts; result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } } - if (!result && (source.flags & 201064448 /* StructuredOrInstantiable */ || target.flags & 201064448 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48947,8 +48959,7 @@ var ts; if (outofbandVarianceMarkerHandler) { originalHandler = outofbandVarianceMarkerHandler; outofbandVarianceMarkerHandler = function (onlyUnreliable) { - propagatingVarianceFlags |= - onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; + propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */; return originalHandler(onlyUnreliable); }; } @@ -49075,17 +49086,6 @@ var ts; } } } - else if (target.flags & 134217728 /* Awaited */ && source.flags & 134217728 /* Awaited */) { - var targetType = target.awaitedType; - var sourceType = instantiateType(source.awaitedType, makeFunctionTypeMapper(reportUnreliableMarkers)); - // An `awaited S` is related to an `awaited T` if `S` is related to `T`: - // - // S <: T ⇒ awaited S <: awaited T - // - if (result = isRelatedTo(sourceType, targetType, reportErrors)) { - return result; - } - } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); @@ -49203,21 +49203,6 @@ var ts; } } } - else if (source.flags & 134217728 /* Awaited */) { - // An `awaited S` is related to `T` if `awaited C` is related to `T`, where `C` is the - // constraint of `S`: - // - // S <: C ^ awaited C <: T ⇒ awaited S <: T - // - // For example `awaited Promise` is assignable to `number`. - var constraint = getConstraintOfType(source.awaitedType); - var awaitedConstraint = constraint && getAwaitedType(constraint); - if (awaitedConstraint) { - if (result = isRelatedTo(awaitedConstraint, target, reportErrors)) { - return result; - } - } - } else { // An empty object type is related to any mapped type that includes a '?' modifier. if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { @@ -50069,11 +50054,13 @@ var ts; variance = 4 /* Independent */; } outofbandVarianceMarkerHandler = oldHandler; - if (unmeasurable) { - variance |= 8 /* Unmeasurable */; - } - if (unreliable) { - variance |= 16 /* Unreliable */; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } } variances.push(variance); }; @@ -50846,12 +50833,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 210 /* BinaryExpression */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 209 /* BinaryExpression */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 157 /* Parameter */: + case 156 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50866,23 +50853,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 245 /* FunctionDeclaration */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 244 /* FunctionDeclaration */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 1 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50896,7 +50883,7 @@ var ts; wideningKind === 1 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 187 /* MappedType */: + case 186 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -51024,7 +51011,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 197394432 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */) || @@ -51320,7 +51307,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 197394432 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51355,9 +51342,6 @@ var ts; inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } - else if (source.flags & 134217728 /* Awaited */ && target.flags & 134217728 /* Awaited */) { - inferFromTypes(source.awaitedType, target.awaitedType); - } else if (target.flags & 16777216 /* Conditional */) { var savePriority = priority; priority |= contravariant ? 16 /* ContravariantConditional */ : 0; @@ -51365,10 +51349,6 @@ var ts; inferToMultipleTypes(source, targetTypes, target.flags); priority = savePriority; } - else if (target.flags & 134217728 /* Awaited */) { - inferFromTypes(source, target.awaitedType); - inferFromTypes(source, createPromiseLikeType(target.awaitedType)); - } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); } @@ -51382,7 +51362,7 @@ var ts; } else { source = getReducedType(source); - if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 197394432 /* Instantiable */))) { + if (!(priority & 128 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -51494,34 +51474,10 @@ var ts; } return typeVariable; } - function isPromiseForType(promiseType, promisedType) { - var _a; - return isThenableType(promiseType) && unwrapAwaitedType((_a = getPromisedTypeOfPromise(promiseType)) !== null && _a !== void 0 ? _a : errorType) === promisedType; - } function inferToMultipleTypes(source, targets, targetFlags) { var typeVariableCount = 0; if (targetFlags & 1048576 /* Union */) { var nakedTypeVariable = void 0; - for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { - var t = targets_2[_i]; - if (getInferenceInfoForType(t)) { - nakedTypeVariable = t; - typeVariableCount++; - } - } - // To better support backwards compatibility with the new `awaited` type, we detect a target - // union of exactly `T | PromiseLike` (for any compatible `PromiseLike`). When encountered, - // we infer from source to the type parameter `T`, where each type of source is mapped to extract - // the promised type of any promise (e.g., `string | Promise` becomes `string | number`). - if (typeVariableCount === 1 && targets.length === 2) { - for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { - var t = targets_3[_a]; - if (!getInferenceInfoForType(t) && isPromiseForType(t, nakedTypeVariable)) { - inferFromTypes(mapType(source, function (s) { var _a; return (_a = getPromisedTypeOfPromise(s)) !== null && _a !== void 0 ? _a : s; }), nakedTypeVariable); - return; - } - } - } var sources = source.flags & 1048576 /* Union */ ? source.types : [source]; var matched_1 = new Array(sources.length); var inferenceCircularity = false; @@ -51529,9 +51485,13 @@ var ts; // track whether inferences were made from that particular type to some target with // equal priority (i.e. of equal quality) to what we would infer for a naked type // parameter. - for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { - var t = targets_4[_b]; - if (!getInferenceInfoForType(t)) { + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t = targets_2[_i]; + if (getInferenceInfoForType(t)) { + nakedTypeVariable = t; + typeVariableCount++; + } + else { for (var i = 0; i < sources.length; i++) { var saveInferencePriority = inferencePriority; inferencePriority = 512 /* MaxValue */; @@ -51569,8 +51529,8 @@ var ts; // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. - for (var _c = 0, targets_5 = targets; _c < targets_5.length; _c++) { - var t = targets_5[_c]; + for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) { + var t = targets_3[_a]; if (getInferenceInfoForType(t)) { typeVariableCount++; } @@ -51584,8 +51544,8 @@ var ts; // we want to infer string for T, not Promise | string. For intersection types // we only infer to single naked type variables. if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) { - for (var _d = 0, targets_6 = targets; _d < targets_6.length; _d++) { - var t = targets_6[_d]; + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t = targets_4[_b]; if (getInferenceInfoForType(t)) { inferWithPriority(source, t, 1 /* NakedTypeVariable */); } @@ -51742,7 +51702,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 162 /* MethodDeclaration */ || kind === 161 /* MethodSignature */ || kind === 163 /* Constructor */; + bivariant = bivariant || kind === 161 /* MethodDeclaration */ || kind === 160 /* MethodSignature */ || kind === 162 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51912,7 +51872,7 @@ var ts; case "AsyncIterator": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 283 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 282 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51933,7 +51893,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 173 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 154 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 172 /* TypeQuery */ ? true : n.kind === 75 /* Identifier */ || n.kind === 153 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -51948,11 +51908,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 104 /* ThisKeyword */: return "0"; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51963,24 +51923,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 201 /* ParenthesizedExpression */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { case 75 /* Identifier */: return target.kind === 75 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 243 /* VariableDeclaration */ || target.kind === 192 /* BindingElement */) && + (target.kind === 242 /* VariableDeclaration */ || target.kind === 191 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 104 /* ThisKeyword */: return target.kind === 104 /* ThisKeyword */; case 102 /* SuperKeyword */: return target.kind === 102 /* SuperKeyword */; - case 219 /* NonNullExpression */: - case 201 /* ParenthesizedExpression */: + case 218 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51990,11 +51950,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 195 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 194 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -52023,7 +51983,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 197394432 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -52056,7 +52016,7 @@ var ts; } } } - if (callExpression.expression.kind === 195 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 194 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -52174,7 +52134,7 @@ var ts; if (flags & 67108864 /* NonPrimitive */) { return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } - if (flags & 197394432 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -52211,15 +52171,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 193 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 282 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 192 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 281 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 210 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 233 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 232 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52236,21 +52196,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return stringType; - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return undefinedType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52258,7 +52218,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 190 /* ObjectBindingPattern */ ? + var type = pattern.kind === 189 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52276,30 +52236,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 232 /* ForInStatement */) { + if (node.parent.parent.kind === 231 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 233 /* ForOfStatement */) { + if (node.parent.parent.kind === 232 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 243 /* VariableDeclaration */ ? + return node.kind === 242 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 243 /* VariableDeclaration */ && node.initializer && + return node.kind === 242 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 192 /* BindingElement */ && node.parent.kind === 210 /* BinaryExpression */ && + node.kind !== 191 /* BindingElement */ && node.parent.kind === 209 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -52311,13 +52271,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 201 /* ParenthesizedExpression */ || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 200 /* ParenthesizedExpression */ || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52337,7 +52297,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52499,12 +52459,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 197 /* CallExpression */ + parent.parent.kind === 196 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 196 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 195 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 210 /* BinaryExpression */ && + parent.parent.kind === 209 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52512,8 +52472,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 243 /* VariableDeclaration */ || declaration.kind === 157 /* Parameter */ || - declaration.kind === 160 /* PropertyDeclaration */ || declaration.kind === 159 /* PropertySignature */) && + return (declaration.kind === 242 /* VariableDeclaration */ || declaration.kind === 156 /* Parameter */ || + declaration.kind === 159 /* PropertyDeclaration */ || declaration.kind === 158 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52526,7 +52486,7 @@ var ts; if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 233 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 232 /* ForOfStatement */) { var expressionType = getTypeOfDottedName(declaration.parent.parent.expression, /*diagnostic*/ undefined); if (expressionType) { return getForOfIterationType(declaration.parent.parent, expressionType); @@ -52552,11 +52512,11 @@ var ts; return getExplicitThisType(node); case 102 /* SuperKeyword */: return checkSuperExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52570,7 +52530,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 227 /* ExpressionStatement */) { + if (node.parent.kind === 226 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 102 /* SuperKeyword */) { @@ -52614,7 +52574,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 91 /* FalseKeyword */ || node.kind === 210 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 91 /* FalseKeyword */ || node.kind === 209 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52689,7 +52649,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 268188671 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -52701,7 +52661,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 219 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 218 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -52782,8 +52742,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 195 /* PropertyAccessExpression */ && - reference.kind !== 196 /* ElementAccessExpression */ && + reference.kind !== 194 /* PropertyAccessExpression */ && + reference.kind !== 195 /* ElementAccessExpression */ && reference.kind !== 104 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -52808,7 +52768,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -52848,14 +52808,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 202 /* FunctionExpression */ || init.kind === 203 /* ArrowFunction */)) { + if (init && (init.kind === 201 /* FunctionExpression */ || init.kind === 202 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 232 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 231 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -52866,7 +52826,7 @@ var ts; if (node.kind === 91 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 210 /* BinaryExpression */) { + if (node.kind === 209 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52897,7 +52857,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 197 /* CallExpression */ ? + var expr = node.kind === 196 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52905,7 +52865,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52955,7 +52915,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 205 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 204 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52963,7 +52923,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 205 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 204 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -53175,10 +53135,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 205 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 204 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (ts.isConstructorAccessExpression(left_1)) { @@ -53302,7 +53262,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 210 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 209 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53326,7 +53286,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -53396,7 +53356,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53610,16 +53570,16 @@ var ts; case 75 /* Identifier */: case 104 /* ThisKeyword */: case 102 /* SuperKeyword */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53664,9 +53624,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 251 /* ModuleBlock */ || - node.kind === 291 /* SourceFile */ || - node.kind === 160 /* PropertyDeclaration */; + node.kind === 250 /* ModuleBlock */ || + node.kind === 290 /* SourceFile */ || + node.kind === 159 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -53688,7 +53648,7 @@ var ts; if (node.kind === 75 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 157 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 156 /* Parameter */) { symbol.isAssigned = true; } } @@ -53704,7 +53664,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 157 /* Parameter */ && + declaration.kind === 156 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -53718,13 +53678,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 195 /* PropertyAccessExpression */ || - parent.kind === 197 /* CallExpression */ && parent.expression === node || - parent.kind === 196 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 192 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 194 /* PropertyAccessExpression */ || + parent.kind === 196 /* CallExpression */ && parent.expression === node || + parent.kind === 195 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 191 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 193200128 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -53763,7 +53723,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { 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 /* Async */)) { @@ -53784,7 +53744,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 246 /* ClassDeclaration */ + if (declaration.kind === 245 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53796,14 +53756,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 215 /* ClassExpression */) { + else if (declaration.kind === 214 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 291 /* SourceFile */) { + while (container.kind !== 290 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 160 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 159 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -53852,7 +53812,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 157 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 156 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -53861,8 +53821,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 202 /* FunctionExpression */ || - flowContainer.kind === 203 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 201 /* FunctionExpression */ || + flowContainer.kind === 202 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -53871,9 +53831,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 264 /* ExportSpecifier */) || - node.parent.kind === 219 /* NonNullExpression */ || - declaration.kind === 243 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 263 /* ExportSpecifier */) || + node.parent.kind === 218 /* NonNullExpression */ || + declaration.kind === 242 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53908,7 +53868,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 281 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 280 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -53931,7 +53891,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53952,7 +53912,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 244 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 243 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -53971,7 +53931,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 201 /* ParenthesizedExpression */) { + while (current.parent.kind === 200 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -53979,7 +53939,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 208 /* PrefixUnaryExpression */ || current.parent.kind === 209 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 207 /* PrefixUnaryExpression */ || current.parent.kind === 208 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -53992,7 +53952,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 160 /* PropertyDeclaration */ || container.kind === 163 /* Constructor */) { + if (container.kind === 159 /* PropertyDeclaration */ || container.kind === 162 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -54060,37 +54020,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 163 /* Constructor */) { + if (container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 203 /* ArrowFunction */) { + if (container.kind === 202 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 163 /* Constructor */: + case 162 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -54140,7 +54100,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 202 /* FunctionExpression */ || container.kind === 245 /* FunctionDeclaration */) && + (container.kind === 201 /* FunctionExpression */ || container.kind === 244 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; return getFlowTypeOfReference(node, classType); @@ -54187,7 +54147,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 202 /* FunctionExpression */ && + if (container.kind === 201 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -54197,16 +54157,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 162 /* MethodDeclaration */ && - container.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 161 /* MethodDeclaration */ && + container.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 202 /* FunctionExpression */ && - container.parent.kind === 282 /* PropertyAssignment */ && - container.parent.parent.kind === 194 /* ObjectLiteralExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && + container.parent.kind === 281 /* PropertyAssignment */ && + container.parent.parent.kind === 193 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -54214,7 +54174,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 202 /* FunctionExpression */ && + else if (container.kind === 201 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -54239,7 +54199,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 301 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 300 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -54253,15 +54213,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 157 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 156 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 197 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 196 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 203 /* ArrowFunction */) { + while (container && container.kind === 202 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -54274,14 +54234,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 155 /* ComputedPropertyName */; }); - if (current && current.kind === 155 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 154 /* ComputedPropertyName */; }); + if (current && current.kind === 154 /* ComputedPropertyName */) { 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 === 194 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -54289,7 +54249,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 163 /* Constructor */) { + if (!isCallExpression && container.kind === 162 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -54358,7 +54318,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 162 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 161 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -54372,7 +54332,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (container.parent.kind === 193 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -54393,7 +54353,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 163 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 162 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -54408,7 +54368,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 163 /* Constructor */; + return container.kind === 162 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -54416,21 +54376,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 194 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 193 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */; } else { - return container.kind === 162 /* MethodDeclaration */ || - container.kind === 161 /* MethodSignature */ || - container.kind === 164 /* GetAccessor */ || - container.kind === 165 /* SetAccessor */ || - container.kind === 160 /* PropertyDeclaration */ || - container.kind === 159 /* PropertySignature */ || - container.kind === 163 /* Constructor */; + return container.kind === 161 /* MethodDeclaration */ || + container.kind === 160 /* MethodSignature */ || + container.kind === 163 /* GetAccessor */ || + container.kind === 164 /* SetAccessor */ || + container.kind === 159 /* PropertyDeclaration */ || + container.kind === 158 /* PropertySignature */ || + container.kind === 162 /* Constructor */; } } } @@ -54438,10 +54398,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 162 /* MethodDeclaration */ || - func.kind === 164 /* GetAccessor */ || - func.kind === 165 /* SetAccessor */) && func.parent.kind === 194 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 202 /* FunctionExpression */ && func.parent.kind === 282 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 161 /* MethodDeclaration */ || + func.kind === 163 /* GetAccessor */ || + func.kind === 164 /* SetAccessor */) && func.parent.kind === 193 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 201 /* FunctionExpression */ && func.parent.kind === 281 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -54453,7 +54413,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54480,7 +54440,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 282 /* PropertyAssignment */) { + if (literal.parent.kind !== 281 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -54494,7 +54454,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 210 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 209 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54547,9 +54507,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 157 /* Parameter */: + case 156 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -54558,7 +54518,7 @@ var ts; var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 192 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + parent.kind !== 191 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { var nameType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(nameType)) { @@ -54599,9 +54559,6 @@ var ts; if (contextualReturnType) { if (functionFlags & 2 /* Async */) { // Async function var contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return contextualReturnType; // Regular function @@ -54613,9 +54570,6 @@ var ts; var contextualType = getContextualType(node); if (contextualType) { var contextualAwaitedType = getAwaitedType(contextualType); - if (contextualAwaitedType && contextualAwaitedType.flags & 134217728 /* Awaited */) { - contextualAwaitedType = contextualAwaitedType.awaitedType; - } return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); } return undefined; @@ -54686,7 +54640,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 199 /* TaggedTemplateExpression */) { + if (template.parent.kind === 198 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54922,21 +54876,21 @@ var ts; case 91 /* FalseKeyword */: case 100 /* NullKeyword */: case 75 /* Identifier */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: return true; - case 195 /* PropertyAccessExpression */: - case 201 /* ParenthesizedExpression */: + case 194 /* PropertyAccessExpression */: + case 200 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 282 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 281 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 274 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -54961,7 +54915,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 197394432 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -54984,7 +54938,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -55022,58 +54976,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 192 /* BindingElement */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 191 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 203 /* ArrowFunction */: - case 236 /* ReturnStatement */: + case 202 /* ArrowFunction */: + case 235 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (parent.expression.kind === 96 /* ImportKeyword */) { return stringType; } /* falls through */ - case 198 /* NewExpression */: + case 197 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 193 /* ArrayLiteralExpression */: { + case 192 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 222 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 212 /* TemplateExpression */); + case 221 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 211 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 201 /* ParenthesizedExpression */: { + case 200 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 274 /* JsxAttribute */: - case 276 /* JsxSpreadAttribute */: + case 273 /* JsxAttribute */: + case 275 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -55230,7 +55184,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 202 /* FunctionExpression */ || node.kind === 203 /* ArrowFunction */; + return node.kind === 201 /* FunctionExpression */ || node.kind === 202 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -55244,7 +55198,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -55289,8 +55243,8 @@ var ts; return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression); } function hasDefaultValue(node) { - return (node.kind === 192 /* BindingElement */ && !!node.initializer) || - (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 191 /* BindingElement */ && !!node.initializer) || + (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -55303,7 +55257,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - var spread = e.kind === 214 /* SpreadElement */ && e.expression; + var spread = e.kind === 213 /* SpreadElement */ && e.expression; var spreadType = spread && checkExpression(spread, checkMode, forceTuple); if (spreadType && isTupleType(spreadType)) { elementTypes.push.apply(elementTypes, getTypeArguments(spreadType)); @@ -55389,7 +55343,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return isNumericComputedName(name); case 75 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -55480,7 +55434,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 190 /* ObjectBindingPattern */ || contextualType.pattern.kind === 194 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 189 /* ObjectBindingPattern */ || contextualType.pattern.kind === 193 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -55494,13 +55448,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 155 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 154 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 282 /* PropertyAssignment */ || - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 281 /* PropertyAssignment */ || + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 282 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 283 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 281 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 282 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -55523,8 +55477,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 282 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 283 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 281 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 282 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -55550,7 +55504,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 284 /* SpreadAssignment */) { + else if (memberDecl.kind === 283 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -55579,7 +55533,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 164 /* GetAccessor */ || memberDecl.kind === 165 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 163 /* GetAccessor */ || memberDecl.kind === 164 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -55604,7 +55558,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 284 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 283 /* SpreadAssignment */) { for (var _i = 0, _a = getPropertiesOfType(contextualType); _i < _a.length; _i++) { var prop = _a[_i]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55646,13 +55600,13 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 197394432 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); } } - return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 193200128 /* InstantiableNonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType)); } @@ -55748,7 +55702,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 276 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 275 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -55774,7 +55728,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 267 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 266 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -56204,7 +56158,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 154 /* QualifiedName */ ? node.right : node.kind === 189 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 153 /* QualifiedName */ ? node.right : node.kind === 188 /* ImportType */ ? node : node.name; if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); @@ -56363,7 +56317,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 201 /* ParenthesizedExpression */) { + while (node.parent.kind === 200 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -56516,7 +56470,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 163 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 162 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -56548,8 +56502,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 246 /* ClassDeclaration */ && - node.parent.kind !== 170 /* TypeReference */ && + else if (valueDeclaration.kind === 245 /* ClassDeclaration */ && + node.parent.kind !== 169 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -56561,22 +56515,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return true; - case 282 /* PropertyAssignment */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 284 /* SpreadAssignment */: - case 155 /* ComputedPropertyName */: - case 222 /* TemplateSpan */: - case 277 /* JsxExpression */: - case 274 /* JsxAttribute */: - case 275 /* JsxAttributes */: - case 276 /* JsxSpreadAttribute */: - case 269 /* JsxOpeningElement */: - case 217 /* ExpressionWithTypeArguments */: - case 280 /* HeritageClause */: + case 281 /* PropertyAssignment */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 283 /* SpreadAssignment */: + case 154 /* ComputedPropertyName */: + case 221 /* TemplateSpan */: + case 276 /* JsxExpression */: + case 273 /* JsxAttribute */: + case 274 /* JsxAttributes */: + case 275 /* JsxSpreadAttribute */: + case 268 /* JsxOpeningElement */: + case 216 /* ExpressionWithTypeArguments */: + case 279 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -56765,16 +56719,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 102 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 189 /* ImportType */: + case 188 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 195 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 194 /* PropertyAccessExpression */ && node.expression.kind === 102 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -56797,7 +56751,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer.kind === 243 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56826,7 +56780,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 232 /* ForInStatement */ && + if (node.kind === 231 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56910,13 +56864,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 158 /* Decorator */) { + else if (node.kind !== 157 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56980,7 +56934,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 214 /* SpreadElement */ || arg.kind === 221 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 213 /* SpreadElement */ || arg.kind === 220 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56994,9 +56948,9 @@ var ts; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 212 /* TemplateExpression */) { + if (node.template.kind === 211 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -57011,7 +56965,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 158 /* Decorator */) { + else if (node.kind === 157 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -57026,7 +56980,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 198 /* NewExpression */); + ts.Debug.assert(node.kind === 197 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -57119,7 +57073,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 158 /* Decorator */) { + if (node.kind !== 157 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -57162,7 +57116,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -57176,7 +57130,7 @@ var ts; } function getArrayifiedType(type) { return type.flags & 1048576 /* Union */ ? mapType(type, getArrayifiedType) : - type.flags & (1 /* Any */ | 197394432 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : + type.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isMutableArrayOrTuple(type) ? type : isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.minLength, type.target.hasRestElement, /*readonly*/ false, type.target.associatedNames) : createArrayType(getIndexedAccessType(type, numberType)); } @@ -57186,7 +57140,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return arg.kind === 221 /* SyntheticExpression */ ? + return arg.kind === 220 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } @@ -57341,7 +57295,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 198 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 197 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -57371,7 +57325,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 216 /* OmittedExpression */) { + if (arg.kind !== 215 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -57412,7 +57366,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 197 /* CallExpression */) { + if (node.kind === 196 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -57420,7 +57374,7 @@ var ts; } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(221 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(220 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -57430,17 +57384,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 199 /* TaggedTemplateExpression */) { + if (node.kind === 198 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 212 /* TemplateExpression */) { + if (template.kind === 211 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 158 /* Decorator */) { + if (node.kind === 157 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -57470,30 +57424,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 157 /* Parameter */: + case 156 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 163 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 162 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 160 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 159 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -57507,17 +57461,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return 1; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return 2; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 157 /* Parameter */: + case 156 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -57642,8 +57596,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 199 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 158 /* Decorator */; + var isTaggedTemplate = node.kind === 198 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 157 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; @@ -57705,7 +57659,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 197 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 196 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -58221,7 +58175,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 163 /* Constructor */) { + if (!modifiers || declaration.kind !== 162 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -58352,16 +58306,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -58452,16 +58406,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 158 /* Decorator */: + case 157 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 269 /* JsxOpeningElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -58550,7 +58504,7 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 195 /* PropertyAccessExpression */) { + while (parent && parent.kind === 194 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -58575,12 +58529,12 @@ var ts; if (node.expression.kind === 102 /* SuperKeyword */) { return voidType; } - if (node.kind === 198 /* NewExpression */) { + if (node.kind === 197 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 163 /* Constructor */ && - declaration.kind !== 167 /* ConstructSignature */ && - declaration.kind !== 172 /* ConstructorType */ && + declaration.kind !== 162 /* Constructor */ && + declaration.kind !== 166 /* ConstructSignature */ && + declaration.kind !== 171 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -58600,7 +58554,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 197 /* CallExpression */ && node.parent.kind === 227 /* ExpressionStatement */ && + if (node.kind === 196 /* CallExpression */ && node.parent.kind === 226 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -58707,9 +58661,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 245 /* FunctionDeclaration */ + ? 244 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 243 /* VariableDeclaration */ + ? 242 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -58737,18 +58691,18 @@ var ts; case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return true; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -58779,8 +58733,14 @@ var ts; } return targetType; } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } function checkNonNullAssertion(node) { - return getNonNullableType(checkExpression(node.expression)); + return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : + getNonNullableType(checkExpression(node.expression)); } function checkMetaProperty(node) { checkGrammarMetaProperty(node); @@ -58798,7 +58758,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 163 /* Constructor */) { + else if (container.kind === 162 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -59024,7 +58984,7 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } return unknownType; @@ -59034,7 +58994,7 @@ var ts; var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = unwrapAwaitedType(getAwaitedType(promisedType) || unknownType); + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } return unknownType; @@ -59065,7 +59025,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 224 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 223 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -59252,7 +59212,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 205 /* TypeOfExpression */) { + if (node.expression.kind === 204 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -59311,11 +59271,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return true; - case 162 /* MethodDeclaration */: - return func.parent.kind === 194 /* ObjectLiteralExpression */; + case 161 /* MethodDeclaration */: + return func.parent.kind === 193 /* ObjectLiteralExpression */; default: return false; } @@ -59341,7 +59301,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 161 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 224 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 160 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 223 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -59374,7 +59334,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -59398,7 +59358,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 202 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 201 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59451,7 +59411,7 @@ var ts; type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 162 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 161 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -59464,7 +59424,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 224 /* Block */) { + if (node.body.kind === 223 /* Block */) { checkSourceElement(node.body); } else { @@ -59554,7 +59514,7 @@ var ts; expr.expression.kind === 104 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && ctor.kind === 163 /* Constructor */)) { + if (!(ctor && ctor.kind === 162 /* Constructor */)) { return true; } if (symbol.valueDeclaration) { @@ -59579,7 +59539,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 257 /* NamespaceImport */; + return !!declaration && declaration.kind === 256 /* NamespaceImport */; } } } @@ -59587,7 +59547,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { // References are combinations of identifiers, parentheses, and property accesses. - var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); + var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 75 /* Identifier */ && !ts.isAccessExpression(node)) { error(expr, invalidReferenceMessage); return false; @@ -59605,7 +59565,7 @@ var ts; error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } - if (expr.kind === 195 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { + if (expr.kind === 194 /* PropertyAccessExpression */ && ts.isPrivateIdentifier(expr.name)) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } var links = getNodeLinks(expr); @@ -59655,7 +59615,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 163 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 162 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -59827,7 +59787,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -59847,7 +59807,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 282 /* PropertyAssignment */ || property.kind === 283 /* ShorthandPropertyAssignment */) { + if (property.kind === 281 /* PropertyAssignment */ || property.kind === 282 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -59860,9 +59820,9 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 283 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 282 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 284 /* SpreadAssignment */) { + else if (property.kind === 283 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -59905,8 +59865,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 216 /* OmittedExpression */) { - if (element.kind !== 214 /* SpreadElement */) { + if (element.kind !== 215 /* OmittedExpression */) { + if (element.kind !== 213 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -59924,7 +59884,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 210 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 209 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59940,7 +59900,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 283 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 282 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -59956,24 +59916,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 210 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 209 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 194 /* ObjectLiteralExpression */) { + if (target.kind === 193 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 193 /* ArrayLiteralExpression */) { + if (target.kind === 192 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 284 /* SpreadAssignment */ ? + var error = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 284 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 283 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59998,36 +59958,36 @@ var ts; case 75 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 199 /* TaggedTemplateExpression */: - case 212 /* TemplateExpression */: + case 198 /* TaggedTemplateExpression */: + case 211 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 106 /* TrueKeyword */: case 91 /* FalseKeyword */: case 100 /* NullKeyword */: - case 147 /* UndefinedKeyword */: - case 202 /* FunctionExpression */: - case 215 /* ClassExpression */: - case 203 /* ArrowFunction */: - case 193 /* ArrayLiteralExpression */: - case 194 /* ObjectLiteralExpression */: - case 205 /* TypeOfExpression */: - case 219 /* NonNullExpression */: - case 268 /* JsxSelfClosingElement */: - case 267 /* JsxElement */: + case 146 /* UndefinedKeyword */: + case 201 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 202 /* ArrowFunction */: + case 192 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 204 /* TypeOfExpression */: + case 218 /* NonNullExpression */: + case 267 /* JsxSelfClosingElement */: + case 266 /* JsxElement */: return true; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -60039,9 +59999,9 @@ var ts; } return false; // Some forms listed here for clarity - case 206 /* VoidExpression */: // Explicit opt-out - case 200 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 218 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 205 /* VoidExpression */: // Explicit opt-out + case 199 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 217 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -60073,7 +60033,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 194 /* ObjectLiteralExpression */ || node.left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 193 /* ObjectLiteralExpression */ || node.left.kind === 192 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 104 /* ThisKeyword */)); break; } @@ -60140,7 +60100,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 194 /* ObjectLiteralExpression */ || left.kind === 193 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 193 /* ObjectLiteralExpression */ || left.kind === 192 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 104 /* ThisKeyword */); } var leftType; @@ -60545,7 +60505,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 275 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 274 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -60594,13 +60554,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 200 /* TypeAssertionExpression */ || node.kind === 218 /* AsExpression */; + return node.kind === 199 /* TypeAssertionExpression */ || node.kind === 217 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 191 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 190 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -60610,7 +60570,7 @@ var ts; var elementTypes = arity ? getTypeArguments(type).slice() : []; for (var i = arity; i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 192 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 191 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { reportImplicitAny(e, anyType); @@ -60639,7 +60599,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 193200128 /* InstantiableNonPrimitive */) { + if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -60676,7 +60636,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -60687,7 +60647,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -60921,11 +60881,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 196 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 75 /* Identifier */ || node.kind === 154 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 173 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 264 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 195 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 75 /* Identifier */ || node.kind === 153 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 172 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 263 /* ExportSpecifier */); // We allow reexporting const enums 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_or_type_query); } @@ -60950,9 +60910,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -60978,78 +60938,78 @@ var ts; return trueType; case 91 /* FalseKeyword */: return falseType; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return checkQualifiedName(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.expression.kind === 96 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 198 /* NewExpression */: + case 197 /* NewExpression */: return checkCallExpression(node, checkMode); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return checkClassExpression(node); - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: return checkAssertion(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return checkNonNullAssertion(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return checkMetaProperty(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return checkDeleteExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return checkVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return checkAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return undefinedWideningType; - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return checkYieldExpression(node); - case 221 /* SyntheticExpression */: + case 220 /* SyntheticExpression */: return node.type; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return checkJsxElement(node, checkMode); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return checkJsxFragment(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -61086,10 +61046,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 163 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 162 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 163 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 162 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -61100,13 +61060,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 163 /* Constructor */ || func.kind === 167 /* ConstructSignature */ || func.kind === 172 /* ConstructorType */) { + if (func.kind === 162 /* Constructor */ || func.kind === 166 /* ConstructSignature */ || func.kind === 171 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 203 /* ArrowFunction */) { + if (func.kind === 202 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 164 /* GetAccessor */ || func.kind === 165 /* SetAccessor */) { + if (func.kind === 163 /* GetAccessor */ || func.kind === 164 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -61164,13 +61124,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 203 /* ArrowFunction */: - case 166 /* CallSignature */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 171 /* FunctionType */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 202 /* ArrowFunction */: + case 165 /* CallSignature */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 170 /* FunctionType */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -61188,7 +61148,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 191 /* ArrayBindingPattern */ || name.kind === 190 /* ObjectBindingPattern */) { + else if (name.kind === 190 /* ArrayBindingPattern */ || name.kind === 189 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -61197,13 +61157,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 171 /* FunctionType */ || node.kind === 245 /* FunctionDeclaration */ || node.kind === 172 /* ConstructorType */ || - node.kind === 166 /* CallSignature */ || node.kind === 163 /* Constructor */ || - node.kind === 167 /* ConstructSignature */) { + else if (node.kind === 170 /* FunctionType */ || node.kind === 244 /* FunctionDeclaration */ || node.kind === 171 /* ConstructorType */ || + node.kind === 165 /* CallSignature */ || node.kind === 162 /* Constructor */ || + node.kind === 166 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -61233,10 +61193,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -61266,7 +61226,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 168 /* IndexSignature */ && node.kind !== 301 /* JSDocFunctionType */) { + if (node.kind !== 167 /* IndexSignature */ && node.kind !== 300 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -61278,7 +61238,7 @@ var ts; var privateIdentifiers = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 163 /* Constructor */) { + if (member.kind === 162 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -61298,16 +61258,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -61370,7 +61330,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 159 /* PropertySignature */) { + if (member.kind === 158 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -61395,7 +61355,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -61415,7 +61375,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -61423,7 +61383,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -61465,7 +61425,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 162 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 161 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -61493,7 +61453,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 160 /* PropertyDeclaration */ && + return n.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -61523,7 +61483,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { var statement = statements_3[_i]; - if (statement.kind === 227 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 226 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -61548,7 +61508,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -61558,7 +61518,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -61567,7 +61527,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -61585,7 +61545,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -61633,7 +61593,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 170 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 169 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -61678,7 +61638,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 178 /* RestType */) { + if (e.kind === 177 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -61687,7 +61647,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 177 /* OptionalType */) { + else if (e.kind === 176 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -61708,7 +61668,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 196 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 195 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -61759,7 +61719,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 181 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 180 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -61776,9 +61736,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 247 /* InterfaceDeclaration */ && - n.parent.kind !== 246 /* ClassDeclaration */ && - n.parent.kind !== 215 /* ClassExpression */ && + if (n.parent.kind !== 246 /* InterfaceDeclaration */ && + n.parent.kind !== 245 /* ClassDeclaration */ && + n.parent.kind !== 214 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -61874,7 +61834,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */) && + var reportError = (node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -61914,7 +61874,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 247 /* InterfaceDeclaration */ || node.parent.kind === 174 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 246 /* InterfaceDeclaration */ || node.parent.kind === 173 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -61925,10 +61885,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 246 /* ClassDeclaration */ || node.kind === 215 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 245 /* ClassDeclaration */ || node.kind === 214 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 245 /* FunctionDeclaration */ || node.kind === 162 /* MethodDeclaration */ || node.kind === 161 /* MethodSignature */ || node.kind === 163 /* Constructor */) { + if (node.kind === 244 /* FunctionDeclaration */ || node.kind === 161 /* MethodDeclaration */ || node.kind === 160 /* MethodSignature */ || node.kind === 162 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -62059,25 +62019,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return 2 /* ExportType */; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 285 /* EnumMember */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 284 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 291 /* SourceFile */: + case 290 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -62085,17 +62045,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 256 /* ImportClause */: + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 255 /* ImportClause */: var result_8 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_8 |= getDeclarationSpaces(d); }); return result_8; - case 243 /* VariableDeclaration */: - case 192 /* BindingElement */: - case 245 /* FunctionDeclaration */: - case 259 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + case 242 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 244 /* FunctionDeclaration */: + case 258 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 75 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -62135,9 +62095,8 @@ var ts; if (typeAsPromise.promisedTypeOfPromise) { return typeAsPromise.promisedTypeOfPromise; } - if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false)) || - isReferenceToType(type, getGlobalPromiseLikeType(/*reportErrors*/ false))) { - return typeAsPromise.promisedTypeOfPromise = getAwaitedType(getTypeArguments(type)[0], errorNode); + if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0]; } var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217 if (isTypeAny(thenFunction)) { @@ -62174,28 +62133,6 @@ var ts; var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0); return awaitedType || errorType; } - /** - * Gets or creates an `awaited T` type for a generic type. - * - * The "awaited type" of a generic type cannot be determined until it is instantiated. As - * a result, an `AwaitedType` for the generic type is created that can be instantiated - * or related later. - */ - function getAwaitedTypeForGenericType(type) { - var typeId = "" + type.id; - var awaitedType = awaitedTypes.get(typeId); - if (!awaitedType) { - awaitedType = createType(134217728 /* Awaited */); - awaitedType.awaitedType = type; - awaitedTypes.set(typeId, awaitedType); - } - return awaitedType; - } - function unwrapAwaitedType(type) { - return type.flags & 1048576 /* Union */ ? - mapType(type, unwrapAwaitedType) : - type.flags & 134217728 /* Awaited */ ? type.awaitedType : type; - } /** * Determines whether a type has a callable `then` member. */ @@ -62203,32 +62140,6 @@ var ts; var thenFunction = getTypeOfPropertyOfType(type, "then"); return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0; } - /** - * Determines whether a type is a generic type whose base constraint could possibly resolve to a different - * type when awaited. A type is a generic "thenable" type when all of the following conditions are met: - * - The type is a generic object type, - * - AND one of the following conditions are met - * - The type has no base constraint, - * - OR The base constraint of the type is `any`, `unknown`, `object`, or the empty object `{}`, - * - OR The base constraint has a callable `then` member. - * This behavior is not entirely sound, as a `T extends { x: any }` could be instantiated with a - * subtype that has a callable `then`, however this is unlikely in practice and this slightly more unsound - * behavior is much more developer friendly. - */ - function isGenericAwaitableType(type) { - if (isGenericObjectType(type)) { - if (type.flags & 2097152 /* Intersection */) { - return ts.some(type.types, isGenericAwaitableType); - } - var baseConstraint = getBaseConstraintOfType(type); - return !baseConstraint || - !!(baseConstraint.flags & (3 /* AnyOrUnknown */ | 67108864 /* NonPrimitive */)) || - baseConstraint === emptyObjectType || - baseConstraint === emptyGenericType || - isThenableType(baseConstraint); - } - return false; - } /** * Gets the "awaited type" of a type. * @@ -62237,60 +62148,22 @@ var ts; * type" is itself a Promise-like, the "promised type" is recursively unwrapped until a * non-promise type is found. * - * This is used to reflect the runtime behavior of the `await` keyword and the `awaited T` - * type. + * This is used to reflect the runtime behavior of the `await` keyword. */ function getAwaitedType(type, errorNode, diagnosticMessage, arg0) { if (isTypeAny(type)) { return type; } - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; } // For a union, get a union of the awaited types of each constituent. // - // For example: - // - // awaited (number | string) -> number | string - // awaited (number | Promise) -> number | string - // awaited (T | string) -> awaited T | string - // awaited (T | Promise) -> awaited T | string - // awaited (T | Promise) -> awaited T - // awaited (T | U) -> awaited T | awaited U - // return typeAsAwaitable.awaitedTypeOfType = mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker); } function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) { - // If the type is already an awaited type, return it. - // - // For example: - // - // awaited T -> awaited T - // - if (type.flags & 134217728 /* Awaited */) { - return type; - } - // We cannot resolve the awaited type for a type variable until it is instantiated. As - // such, we create an `awaited T` type that can either be instantiated or related later. - // - // For example: - // - // T -> awaited T - // - if (isGenericAwaitableType(type)) { - return getAwaitedTypeForGenericType(type); - } var typeAsAwaitable = type; if (typeAsAwaitable.awaitedTypeOfType) { return typeAsAwaitable.awaitedTypeOfType; @@ -62474,24 +62347,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 157 /* Parameter */: + case 156 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -62538,14 +62411,14 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return node.typeName; } } @@ -62554,13 +62427,13 @@ var ts; var commonEntityName; for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { var typeNode = types_19[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -62606,14 +62479,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 157 /* Parameter */) { + if (node.kind === 156 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -62622,23 +62495,23 @@ var ts; } } break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - var otherKind = node.kind === 164 /* GetAccessor */ ? 165 /* SetAccessor */ : 164 /* GetAccessor */; + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + var otherKind = node.kind === 163 /* GetAccessor */ ? 164 /* SetAccessor */ : 163 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 157 /* Parameter */: + case 156 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -62701,7 +62574,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 154 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 153 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -62742,7 +62615,7 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -62755,7 +62628,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 154 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -62784,7 +62657,7 @@ var ts; } } } - var body = node.kind === 161 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 160 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -62826,42 +62699,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 291 /* SourceFile */: - case 250 /* ModuleDeclaration */: - case 224 /* Block */: - case 252 /* CaseBlock */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 290 /* SourceFile */: + case 249 /* ModuleDeclaration */: + case 223 /* Block */: + case 251 /* CaseBlock */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 163 /* Constructor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 162 /* Constructor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 248 /* TypeAliasDeclaration */: - case 247 /* InterfaceDeclaration */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 247 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 182 /* InferType */: + case 181 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -62881,11 +62754,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 162 /* MethodDeclaration */: - case 160 /* PropertyDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - if (member.kind === 165 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 161 /* MethodDeclaration */: + case 159 /* PropertyDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + if (member.kind === 164 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -62896,7 +62769,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -62904,8 +62777,8 @@ var ts; } } break; - case 168 /* IndexSignature */: - case 223 /* SemicolonClassElement */: + case 167 /* IndexSignature */: + case 222 /* SemicolonClassElement */: // Can't be private break; default: @@ -62932,7 +62805,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 182 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 181 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -63015,7 +62888,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 257 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 256 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -63033,7 +62906,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 243 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 244 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 242 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 243 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -63054,7 +62927,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 226 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 225 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -63068,22 +62941,22 @@ var ts; switch (name.kind) { case 75 /* Identifier */: return ts.idText(name); - case 191 /* ArrayBindingPattern */: - case 190 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 256 /* ImportClause */ || node.kind === 259 /* ImportSpecifier */ || node.kind === 257 /* NamespaceImport */; + return node.kind === 255 /* ImportClause */ || node.kind === 258 /* ImportSpecifier */ || node.kind === 256 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 256 /* ImportClause */ ? decl : decl.kind === 257 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 255 /* ImportClause */ ? decl : decl.kind === 256 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 224 /* Block */) { + if (node.kind === 223 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -63113,12 +62986,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 160 /* PropertyDeclaration */ || - node.kind === 159 /* PropertySignature */ || - node.kind === 162 /* MethodDeclaration */ || - node.kind === 161 /* MethodSignature */ || - node.kind === 164 /* GetAccessor */ || - node.kind === 165 /* SetAccessor */) { + if (node.kind === 159 /* PropertyDeclaration */ || + node.kind === 158 /* PropertySignature */ || + node.kind === 161 /* MethodDeclaration */ || + node.kind === 160 /* MethodSignature */ || + node.kind === 163 /* GetAccessor */ || + node.kind === 164 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -63127,7 +63000,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 157 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 156 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -63184,7 +63057,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63199,7 +63072,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 291 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 290 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -63234,7 +63107,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 243 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 242 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -63246,17 +63119,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 244 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 226 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 243 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 225 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 224 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 251 /* ModuleBlock */ || - container.kind === 250 /* ModuleDeclaration */ || - container.kind === 291 /* SourceFile */); + (container.kind === 223 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 250 /* ModuleBlock */ || + container.kind === 249 /* ModuleDeclaration */ || + container.kind === 290 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -63286,18 +63159,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 155 /* ComputedPropertyName */) { + if (node.name.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 192 /* BindingElement */) { - if (node.parent.kind === 190 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 191 /* BindingElement */) { + if (node.parent.kind === 189 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 155 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 154 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -63318,19 +63191,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 191 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 190 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 157 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 156 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 232 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 231 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -63367,7 +63240,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 232 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 231 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -63393,10 +63266,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */) { + if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -63408,7 +63281,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 160 /* PropertyDeclaration */ || nextDeclaration.kind === 159 /* PropertySignature */ + var message = nextDeclaration.kind === 159 /* PropertyDeclaration */ || nextDeclaration.kind === 158 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -63418,8 +63291,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 157 /* Parameter */ && right.kind === 243 /* VariableDeclaration */) || - (left.kind === 243 /* VariableDeclaration */ && right.kind === 157 /* Parameter */)) { + if ((left.kind === 156 /* Parameter */ && right.kind === 242 /* VariableDeclaration */) || + (left.kind === 242 /* VariableDeclaration */ && right.kind === 156 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -63459,7 +63332,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 225 /* EmptyStatement */) { + if (node.thenStatement.kind === 224 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -63530,12 +63403,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 243 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -63569,14 +63442,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -63608,7 +63481,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 244 /* VariableDeclarationList */) { + if (node.initializer.kind === 243 /* VariableDeclarationList */) { 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); @@ -63622,7 +63495,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 193 /* ArrayLiteralExpression */ || varExpr.kind === 194 /* ObjectLiteralExpression */) { + if (varExpr.kind === 192 /* ArrayLiteralExpression */ || varExpr.kind === 193 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -63635,7 +63508,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 193200128 /* InstantiableNonPrimitive */)) { + if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); @@ -64275,7 +64148,7 @@ var ts; var isGenerator = !!(functionFlags & 1 /* Generator */); var isAsync = !!(functionFlags & 2 /* Async */); return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync) || errorType : - isAsync ? unwrapAwaitedType(getAwaitedType(returnType) || errorType) : + isAsync ? getPromisedTypeOfPromise(returnType) || errorType : returnType; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { @@ -64297,12 +64170,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 165 /* SetAccessor */) { + if (func.kind === 164 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 163 /* Constructor */) { + else if (func.kind === 162 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -64310,7 +64183,7 @@ var ts; else if (getReturnTypeFromAnnotation(func)) { var unwrappedReturnType = unwrapReturnType(returnType, functionFlags); var unwrappedExprType = functionFlags & 2 /* Async */ - ? unwrapAwaitedType(checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)) + ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) : exprType; if (unwrappedReturnType) { // If the function has a return type, but promisedType is @@ -64320,7 +64193,7 @@ var ts; } } } - else if (func.kind !== 163 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 162 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -64349,7 +64222,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 279 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 278 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -64358,7 +64231,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 278 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 277 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -64390,7 +64263,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 239 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 238 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -64497,8 +64370,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 210 /* BinaryExpression */ || - name.kind === 155 /* ComputedPropertyName */ || + (propDeclaration.kind === 209 /* BinaryExpression */ || + name.kind === 154 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -64575,7 +64448,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 170 /* TypeReference */) { + if (node.kind === 169 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -64821,7 +64694,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 246 /* ClassDeclaration */ || d.kind === 247 /* InterfaceDeclaration */; + return d.kind === 245 /* ClassDeclaration */ || d.kind === 246 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -64876,7 +64749,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 215 /* ClassExpression */) { + if (derivedClassDecl.kind === 214 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -64898,7 +64771,7 @@ var ts; // property/accessor is overridden with property/accessor if (!compilerOptions.useDefineForClassFields || baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 247 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 246 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -64913,7 +64786,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 160 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 159 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -65010,7 +64883,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 160 /* PropertyDeclaration */ && + return node.kind === 159 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -65034,7 +64907,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 247 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 246 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -65140,7 +65013,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -65150,7 +65023,7 @@ var ts; } } break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -65179,7 +65052,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return evaluate(expr.expression); case 75 /* Identifier */: var identifier = expr; @@ -65187,14 +65060,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 195 /* PropertyAccessExpression */) { + if (ex.kind === 194 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -65224,8 +65097,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 75 /* Identifier */ || - node.kind === 195 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 196 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 194 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 195 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -65261,7 +65134,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 249 /* EnumDeclaration */) { + if (declaration.kind !== 248 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -65289,8 +65162,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 246 /* ClassDeclaration */ || - (declaration.kind === 245 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 245 /* ClassDeclaration */ || + (declaration.kind === 244 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -65353,7 +65226,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 246 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 245 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -65403,23 +65276,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 192 /* BindingElement */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 242 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -65430,12 +65303,12 @@ var ts; break; } // falls through - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 245 /* FunctionDeclaration */: - case 247 /* InterfaceDeclaration */: - case 250 /* ModuleDeclaration */: - case 248 /* TypeAliasDeclaration */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 246 /* InterfaceDeclaration */: + case 249 /* ModuleDeclaration */: + case 247 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -65458,12 +65331,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return node; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: do { node = node.left; } while (node.kind !== 75 /* Identifier */); return node; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -65483,9 +65356,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 261 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 260 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -65520,14 +65393,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 264 /* ExportSpecifier */ ? + var message = node.kind === 263 /* ExportSpecifier */ ? 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)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 264 /* ExportSpecifier */ + && node.kind === 263 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -65555,7 +65428,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 256 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -65579,7 +65452,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 266 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 265 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -65624,10 +65497,10 @@ var ts; else if (!ts.isNamespaceExport(node.exportClause)) { checkImportBinding(node.exportClause); } - var inAmbientExternalModule = node.parent.kind === 251 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 251 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 250 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 250 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 291 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 290 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -65645,14 +65518,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 262 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 261 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 291 /* SourceFile */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 250 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 290 /* SourceFile */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 249 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -65708,8 +65581,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -65823,165 +65696,165 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 250 /* ModuleDeclaration */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 245 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 244 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 226 /* FirstStatement */ && kind <= 242 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 225 /* FirstStatement */ && kind <= 241 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return checkTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return checkParameter(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return checkPropertySignature(node); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 166 /* CallSignature */: - case 167 /* ConstructSignature */: - case 168 /* IndexSignature */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 165 /* CallSignature */: + case 166 /* ConstructSignature */: + case 167 /* IndexSignature */: return checkSignatureDeclaration(node); - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: return checkMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return checkConstructorDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return checkAccessorDeclaration(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return checkTypeReferenceNode(node); - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return checkTypePredicate(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return checkTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return checkTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return checkArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return checkTupleType(node); - case 179 /* UnionType */: - case 180 /* IntersectionType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 183 /* ParenthesizedType */: - case 177 /* OptionalType */: - case 178 /* RestType */: + case 182 /* ParenthesizedType */: + case 176 /* OptionalType */: + case 177 /* RestType */: return checkSourceElement(node.type); - case 184 /* ThisType */: + case 183 /* ThisType */: return checkThisType(node); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return checkTypeOperator(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return checkConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return checkInferType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return checkImportType(node); - case 308 /* JSDocAugmentsTag */: + case 307 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocImplementsTag */: + case 308 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 323 /* JSDocTypedefTag */: - case 316 /* JSDocCallbackTag */: - case 317 /* JSDocEnumTag */: + case 322 /* JSDocTypedefTag */: + case 315 /* JSDocCallbackTag */: + case 316 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 321 /* JSDocTypeTag */: + case 320 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 318 /* JSDocParameterTag */: + case 317 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 299 /* JSDocNonNullableType */: - case 298 /* JSDocNullableType */: - case 296 /* JSDocAllType */: - case 297 /* JSDocUnknownType */: - case 305 /* JSDocTypeLiteral */: + case 298 /* JSDocNonNullableType */: + case 297 /* JSDocNullableType */: + case 295 /* JSDocAllType */: + case 296 /* JSDocUnknownType */: + case 304 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 302 /* JSDocVariadicType */: + case 301 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 295 /* JSDocTypeExpression */: + case 294 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return checkMappedType(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 224 /* Block */: - case 251 /* ModuleBlock */: + case 223 /* Block */: + case 250 /* ModuleBlock */: return checkBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return checkVariableStatement(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return checkExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return checkIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return checkDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return checkWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return checkForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return checkForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return checkForOfStatement(node); - case 234 /* ContinueStatement */: - case 235 /* BreakStatement */: + case 233 /* ContinueStatement */: + case 234 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return checkReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return checkWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return checkSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return checkLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return checkThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return checkTryStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return checkBindingElement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return checkClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return checkImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return checkExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return checkExportAssignment(node); - case 225 /* EmptyStatement */: - case 242 /* DebuggerStatement */: + case 224 /* EmptyStatement */: + case 241 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -66076,33 +65949,33 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 199 /* TaggedTemplateExpression */: - case 158 /* Decorator */: - case 269 /* JsxOpeningElement */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 198 /* TaggedTemplateExpression */: + case 157 /* Decorator */: + case 268 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 267 /* JsxElement */: + case 266 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -66245,17 +66118,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 291 /* SourceFile */: + case 290 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -66263,8 +66136,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -66273,7 +66146,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -66321,16 +66194,16 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 156 /* TypeParameter */: - case 246 /* ClassDeclaration */: - case 247 /* InterfaceDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 155 /* TypeParameter */: + case 245 /* ClassDeclaration */: + case 246 /* InterfaceDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return true; - case 256 /* ImportClause */: + case 255 /* ImportClause */: return node.isTypeOnly; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -66338,16 +66211,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 154 /* QualifiedName */) { + while (node.parent.kind === 153 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 170 /* TypeReference */; + return node.parent.kind === 169 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 195 /* PropertyAccessExpression */) { + while (node.parent.kind === 194 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 217 /* ExpressionWithTypeArguments */; + return node.parent.kind === 216 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -66375,13 +66248,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 154 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 153 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 254 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 253 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 260 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 259 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -66407,7 +66280,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 189 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 188 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -66417,7 +66290,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 195 /* PropertyAccessExpression */ && + name.parent.kind === 194 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -66427,7 +66300,7 @@ var ts; } } } - if (name.parent.kind === 260 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 259 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -66437,7 +66310,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 254 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 253 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -66455,7 +66328,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 217 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 216 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -66471,10 +66344,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 318 /* JSDocParameterTag */) { + if (name.parent.kind === 317 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 156 /* TypeParameter */ && name.parent.parent.kind === 322 /* JSDocTemplateTag */) { + if (name.parent.kind === 155 /* TypeParameter */ && name.parent.parent.kind === 321 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -66491,12 +66364,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 195 /* PropertyAccessExpression */ || name.kind === 154 /* QualifiedName */) { + else if (name.kind === 194 /* PropertyAccessExpression */ || name.kind === 153 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 195 /* PropertyAccessExpression */) { + if (name.kind === 194 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -66506,17 +66379,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 170 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 169 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (name.parent.kind === 169 /* TypePredicate */) { + if (name.parent.kind === 168 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -66539,8 +66412,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 192 /* BindingElement */ && - grandParent.kind === 190 /* ObjectBindingPattern */ && + else if (parent.kind === 191 /* BindingElement */ && + grandParent.kind === 189 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -66552,8 +66425,8 @@ var ts; switch (node.kind) { case 75 /* Identifier */: case 76 /* PrivateIdentifier */: - case 195 /* PropertyAccessExpression */: - case 154 /* QualifiedName */: + case 194 /* PropertyAccessExpression */: + case 153 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 104 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -66567,14 +66440,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 184 /* ThisType */: + case 183 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 102 /* SuperKeyword */: return checkExpression(node).symbol; - case 130 /* ConstructorKeyword */: + case 129 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 163 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 162 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -66585,7 +66458,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 255 /* ImportDeclaration */ || node.parent.kind === 261 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 254 /* ImportDeclaration */ || node.parent.kind === 260 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -66607,7 +66480,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 80 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 89 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -66616,7 +66489,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 283 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 282 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -66687,23 +66560,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 194 /* ObjectLiteralExpression */ || expr.kind === 193 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 193 /* ObjectLiteralExpression */ || expr.kind === 192 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 233 /* ForOfStatement */) { + if (expr.parent.kind === 232 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 210 /* BinaryExpression */) { + if (expr.parent.kind === 209 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 282 /* PropertyAssignment */) { + if (expr.parent.kind === 281 /* PropertyAssignment */) { var node_4 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_4) || errorType; var propertyIndex = ts.indexOfNode(node_4.properties, expr.parent); @@ -66751,7 +66624,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -66807,7 +66680,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 195 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 194 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -66863,7 +66736,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 291 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 290 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -66891,7 +66764,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 281 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 280 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -66922,7 +66795,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 224 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 223 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -66963,19 +66836,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 256 /* ImportClause */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 255 /* ImportClause */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return node.expression && node.expression.kind === 75 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -66984,7 +66857,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 291 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 290 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -67086,15 +66959,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 285 /* EnumMember */: - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 284 /* EnumMember */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 285 /* EnumMember */) { + if (node.kind === 284 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -67335,12 +67208,12 @@ var ts; getJsxFactoryEntity: getJsxFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 165 /* SetAccessor */ ? 164 /* GetAccessor */ : 165 /* SetAccessor */; + var otherKind = accessor.kind === 164 /* SetAccessor */ ? 163 /* GetAccessor */ : 164 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 165 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 164 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 164 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 163 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -67356,7 +67229,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 291 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 290 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -67365,7 +67238,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 217 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 280 /* HeritageClause */; + return node.parent && node.parent.kind === 216 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 279 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -67377,7 +67250,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 195 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 75 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 194 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -67428,7 +67301,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 291 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 290 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -67456,12 +67329,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 250 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 249 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 291 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 290 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -67653,14 +67526,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 162 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 161 /* MethodDeclaration */ && !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 === 164 /* GetAccessor */ || node.kind === 165 /* SetAccessor */) { + else if (node.kind === 163 /* GetAccessor */ || node.kind === 164 /* SetAccessor */) { 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); @@ -67677,17 +67550,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 139 /* ReadonlyKeyword */) { - if (node.kind === 159 /* PropertySignature */ || node.kind === 161 /* MethodSignature */) { + if (modifier.kind !== 138 /* ReadonlyKeyword */) { + if (node.kind === 158 /* PropertySignature */ || node.kind === 160 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 168 /* IndexSignature */) { + if (node.kind === 167 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 81 /* ConstKeyword */: - if (node.kind !== 249 /* EnumDeclaration */) { + if (node.kind !== 248 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(81 /* ConstKeyword */)); } break; @@ -67707,7 +67580,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -67733,10 +67606,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + else if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -67748,11 +67621,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 139 /* ReadonlyKeyword */: + case 138 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 160 /* PropertyDeclaration */ && node.kind !== 159 /* PropertySignature */ && node.kind !== 168 /* IndexSignature */ && node.kind !== 157 /* Parameter */) { + else if (node.kind !== 159 /* PropertyDeclaration */ && node.kind !== 158 /* PropertySignature */ && node.kind !== 167 /* IndexSignature */ && node.kind !== 156 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -67775,19 +67648,19 @@ var ts; else if (ts.isClassLike(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 84 /* DefaultKeyword */: - var container = node.parent.kind === 291 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 250 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 290 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 249 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 131 /* DeclareKeyword */: + case 130 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -67797,10 +67670,10 @@ var ts; else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 251 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 250 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -67813,14 +67686,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 246 /* ClassDeclaration */) { - if (node.kind !== 162 /* MethodDeclaration */ && - node.kind !== 160 /* PropertyDeclaration */ && - node.kind !== 164 /* GetAccessor */ && - node.kind !== 165 /* SetAccessor */) { + if (node.kind !== 245 /* ClassDeclaration */) { + if (node.kind !== 161 /* MethodDeclaration */ && + node.kind !== 159 /* PropertyDeclaration */ && + node.kind !== 163 /* GetAccessor */ && + node.kind !== 164 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 246 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 245 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -67842,7 +67715,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 157 /* Parameter */) { + else if (node.kind === 156 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -67850,7 +67723,7 @@ var ts; break; } } - if (node.kind === 163 /* Constructor */) { + if (node.kind === 162 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -67865,13 +67738,13 @@ var ts; } return false; } - else if ((node.kind === 255 /* ImportDeclaration */ || node.kind === 254 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 254 /* ImportDeclaration */ || node.kind === 253 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 157 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 156 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -67892,37 +67765,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: - case 168 /* IndexSignature */: - case 250 /* ModuleDeclaration */: - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: - case 157 /* Parameter */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: + case 167 /* IndexSignature */: + case 249 /* ModuleDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: + case 156 /* Parameter */: return false; default: - if (node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { return false; } switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 126 /* AsyncKeyword */); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 122 /* AbstractKeyword */); - case 247 /* InterfaceDeclaration */: - case 226 /* VariableStatement */: - case 248 /* TypeAliasDeclaration */: + case 246 /* InterfaceDeclaration */: + case 225 /* VariableStatement */: + case 247 /* TypeAliasDeclaration */: return true; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 81 /* ConstKeyword */); default: ts.Debug.fail(); @@ -67935,10 +67808,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 162 /* MethodDeclaration */: - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: - case 203 /* ArrowFunction */: + case 161 /* MethodDeclaration */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: + case 202 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -68053,7 +67926,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 !== 144 /* StringKeyword */ && parameter.type.kind !== 141 /* NumberKeyword */) { + if (parameter.type.kind !== 143 /* StringKeyword */ && parameter.type.kind !== 140 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -68095,7 +67968,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 216 /* OmittedExpression */) { + if (arg.kind === 215 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -68172,20 +68045,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 155 /* ComputedPropertyName */) { + if (node.kind !== 154 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 210 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 209 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 245 /* FunctionDeclaration */ || - node.kind === 202 /* FunctionExpression */ || - node.kind === 162 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 244 /* FunctionDeclaration */ || + node.kind === 201 /* FunctionExpression */ || + node.kind === 161 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -68204,7 +68077,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 284 /* SpreadAssignment */) { + if (prop.kind === 283 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -68215,11 +68088,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 155 /* ComputedPropertyName */) { + if (name.kind === 154 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 283 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 282 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -68232,7 +68105,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 162 /* MethodDeclaration */) { + if (mod.kind !== 126 /* AsyncKeyword */ || prop.kind !== 161 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -68247,10 +68120,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -68258,13 +68131,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -68303,7 +68176,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 276 /* JsxSpreadAttribute */) { + if (attr.kind === 275 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -68313,7 +68186,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 277 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 276 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -68327,14 +68200,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 233 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 232 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 163 /* Constructor */) { + if (func && func.kind !== 162 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -68345,7 +68218,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 244 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 243 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -68360,20 +68233,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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 === 232 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 231 /* ForInStatement */ ? 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); @@ -68398,11 +68271,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 164 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 163 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 165 /* SetAccessor */) { + if (accessor.kind === 164 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -68424,21 +68297,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 164 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 163 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 148 /* UniqueKeyword */) { - if (node.type.kind !== 145 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(145 /* SymbolKeyword */)); + if (node.operator === 147 /* UniqueKeyword */) { + if (node.type.kind !== 144 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(144 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 75 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -68450,13 +68323,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -68465,9 +68338,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 139 /* ReadonlyKeyword */) { - if (node.type.kind !== 175 /* ArrayType */ && node.type.kind !== 176 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(145 /* SymbolKeyword */)); + else if (node.operator === 138 /* ReadonlyKeyword */) { + if (node.type.kind !== 174 /* ArrayType */ && node.type.kind !== 175 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(144 /* SymbolKeyword */)); } } } @@ -68480,8 +68353,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 162 /* MethodDeclaration */) { - if (node.parent.kind === 194 /* ObjectLiteralExpression */) { + if (node.kind === 161 /* MethodDeclaration */) { + if (node.parent.kind === 193 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 126 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -68509,14 +68382,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 162 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 161 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -68527,11 +68400,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 234 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 233 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -68539,8 +68412,8 @@ var ts; return false; } break; - case 238 /* SwitchStatement */: - if (node.kind === 235 /* BreakStatement */ && !node.label) { + case 237 /* SwitchStatement */: + if (node.kind === 234 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -68555,13 +68428,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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 === 235 /* BreakStatement */ + var message = node.kind === 234 /* BreakStatement */ ? 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); @@ -68585,12 +68458,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 208 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 207 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -68621,7 +68494,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 232 /* ForInStatement */ && node.parent.parent.kind !== 233 /* ForOfStatement */) { + if (node.parent.parent.kind !== 231 /* ForInStatement */ && node.parent.parent.kind !== 232 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -68634,7 +68507,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 226 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 225 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); @@ -68697,15 +68570,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 228 /* IfStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 237 /* WithStatement */: - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 227 /* IfStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: return false; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -68789,7 +68662,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 247 /* InterfaceDeclaration */) { + else if (node.parent.kind === 246 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68797,7 +68670,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 174 /* TypeLiteral */) { + else if (node.parent.kind === 173 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -68826,13 +68699,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 247 /* InterfaceDeclaration */ || - node.kind === 248 /* TypeAliasDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 254 /* ImportEqualsDeclaration */ || - node.kind === 261 /* ExportDeclaration */ || - node.kind === 260 /* ExportAssignment */ || - node.kind === 253 /* NamespaceExportDeclaration */ || + if (node.kind === 246 /* InterfaceDeclaration */ || + node.kind === 247 /* TypeAliasDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 253 /* ImportEqualsDeclaration */ || + node.kind === 260 /* ExportDeclaration */ || + node.kind === 259 /* ExportAssignment */ || + node.kind === 252 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -68841,7 +68714,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 === 226 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 225 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -68864,7 +68737,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 224 /* Block */ || node.parent.kind === 251 /* ModuleBlock */ || node.parent.kind === 291 /* SourceFile */) { + if (node.parent.kind === 223 /* Block */ || node.parent.kind === 250 /* ModuleBlock */ || node.parent.kind === 290 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -68886,10 +68759,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 188 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 187 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 285 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 284 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -69064,14 +68937,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 245 /* FunctionDeclaration */ && declaration.kind !== 162 /* MethodDeclaration */) || + return (declaration.kind !== 244 /* FunctionDeclaration */ && declaration.kind !== 161 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -69079,14 +68952,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 256 /* ImportClause */: // For default import - case 254 /* ImportEqualsDeclaration */: - case 257 /* NamespaceImport */: - case 259 /* ImportSpecifier */: // For rename import `x as y` + case 255 /* ImportClause */: // For default import + case 253 /* ImportEqualsDeclaration */: + case 256 /* NamespaceImport */: + case 258 /* ImportSpecifier */: // For rename import `x as y` return true; case 75 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 259 /* ImportSpecifier */; + return decl.parent.kind === 258 /* ImportSpecifier */; default: return false; } @@ -69349,7 +69222,7 @@ var ts; result.push(createModifier(89 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(131 /* DeclareKeyword */)); + result.push(createModifier(130 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { result.push(createModifier(84 /* DefaultKeyword */)); @@ -69373,7 +69246,7 @@ var ts; result.push(createModifier(120 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(139 /* ReadonlyKeyword */)); + result.push(createModifier(138 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(126 /* AsyncKeyword */)); @@ -69383,7 +69256,7 @@ var ts; ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(154 /* QualifiedName */); + var node = createSynthesizedNode(153 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -69402,7 +69275,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(155 /* ComputedPropertyName */); + var node = createSynthesizedNode(154 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -69415,7 +69288,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(156 /* TypeParameter */); + var node = createSynthesizedNode(155 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -69431,7 +69304,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(157 /* Parameter */); + var node = createSynthesizedNode(156 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -69455,7 +69328,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(158 /* Decorator */); + var node = createSynthesizedNode(157 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -69468,7 +69341,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(159 /* PropertySignature */); + var node = createSynthesizedNode(158 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -69488,7 +69361,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(160 /* PropertyDeclaration */); + var node = createSynthesizedNode(159 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69512,7 +69385,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(161 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(160 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -69529,7 +69402,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(162 /* MethodDeclaration */); + var node = createSynthesizedNode(161 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -69589,7 +69462,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(163 /* Constructor */); + var node = createSynthesizedNode(162 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -69609,7 +69482,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(164 /* GetAccessor */); + var node = createSynthesizedNode(163 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69632,7 +69505,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(165 /* SetAccessor */); + var node = createSynthesizedNode(164 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -69653,7 +69526,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(165 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -69661,7 +69534,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(167 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -69669,7 +69542,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(168 /* IndexSignature */); + var node = createSynthesizedNode(167 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -69713,7 +69586,7 @@ var ts; } ts.createTypePredicateNode = createTypePredicateNode; function createTypePredicateNodeWithModifier(assertsModifier, parameterName, type) { - var node = createSynthesizedNode(169 /* TypePredicate */); + var node = createSynthesizedNode(168 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -69733,7 +69606,7 @@ var ts; } ts.updateTypePredicateNodeWithModifier = updateTypePredicateNodeWithModifier; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(170 /* TypeReference */); + var node = createSynthesizedNode(169 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -69747,7 +69620,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(171 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(170 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -69755,7 +69628,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(172 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(171 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -69763,7 +69636,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(173 /* TypeQuery */); + var node = createSynthesizedNode(172 /* TypeQuery */); node.exprName = exprName; return node; } @@ -69775,7 +69648,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(174 /* TypeLiteral */); + var node = createSynthesizedNode(173 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -69787,7 +69660,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(175 /* ArrayType */); + var node = createSynthesizedNode(174 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -69799,7 +69672,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(176 /* TupleType */); + var node = createSynthesizedNode(175 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -69811,7 +69684,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(177 /* OptionalType */); + var node = createSynthesizedNode(176 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -69823,7 +69696,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(178 /* RestType */); + var node = createSynthesizedNode(177 /* RestType */); node.type = type; return node; } @@ -69835,7 +69708,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(179 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(178 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -69843,7 +69716,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(180 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(179 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -69862,7 +69735,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(181 /* ConditionalType */); + var node = createSynthesizedNode(180 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -69880,7 +69753,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(182 /* InferType */); + var node = createSynthesizedNode(181 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -69892,7 +69765,7 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(189 /* ImportType */); + var node = createSynthesizedNode(188 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); @@ -69910,7 +69783,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(183 /* ParenthesizedType */); + var node = createSynthesizedNode(182 /* ParenthesizedType */); node.type = type; return node; } @@ -69922,12 +69795,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(184 /* ThisType */); + return createSynthesizedNode(183 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(185 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 135 /* KeyOfKeyword */; + var node = createSynthesizedNode(184 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 134 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -69937,7 +69810,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(186 /* IndexedAccessType */); + var node = createSynthesizedNode(185 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -69951,7 +69824,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(187 /* MappedType */); + var node = createSynthesizedNode(186 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -69969,7 +69842,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(188 /* LiteralType */); + var node = createSynthesizedNode(187 /* LiteralType */); node.literal = literal; return node; } @@ -69982,7 +69855,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(190 /* ObjectBindingPattern */); + var node = createSynthesizedNode(189 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -69994,7 +69867,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(191 /* ArrayBindingPattern */); + var node = createSynthesizedNode(190 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -70006,7 +69879,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(192 /* BindingElement */); + var node = createSynthesizedNode(191 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -70025,7 +69898,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(193 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(192 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -70039,7 +69912,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(194 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(193 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -70053,7 +69926,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -70061,10 +69934,8 @@ var ts; } ts.createPropertyAccess = createPropertyAccess; function updatePropertyAccess(node, expression, name) { - if (ts.isOptionalChain(node) && ts.isIdentifier(node.name) && ts.isIdentifier(name)) { - // Not sure why this cast was necessary: the previous line should already establish that node.name is an identifier - var theNode = node; - return updatePropertyAccessChain(theNode, expression, node.questionDotToken, name); + if (ts.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier)); } // Because we are updating existed propertyAccess we want to inherit its emitFlags // instead of using the default from createPropertyAccess @@ -70075,7 +69946,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createSynthesizedNode(195 /* PropertyAccessExpression */); + var node = createSynthesizedNode(194 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70096,7 +69967,7 @@ var ts; } ts.updatePropertyAccessChain = updatePropertyAccessChain; function createElementAccess(expression, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -70113,7 +69984,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createElementAccessChain(expression, questionDotToken, index) { - var node = createSynthesizedNode(196 /* ElementAccessExpression */); + var node = createSynthesizedNode(195 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70131,7 +70002,7 @@ var ts; } ts.updateElementAccessChain = updateElementAccessChain; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -70150,7 +70021,7 @@ var ts; } ts.updateCall = updateCall; function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createSynthesizedNode(197 /* CallExpression */); + var node = createSynthesizedNode(196 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = ts.parenthesizeForAccess(expression); node.questionDotToken = questionDotToken; @@ -70170,7 +70041,7 @@ var ts; } ts.updateCallChain = updateCallChain; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(198 /* NewExpression */); + var node = createSynthesizedNode(197 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -70186,7 +70057,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(199 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(198 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -70209,7 +70080,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(200 /* TypeAssertionExpression */); + var node = createSynthesizedNode(199 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -70223,7 +70094,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(201 /* ParenthesizedExpression */); + var node = createSynthesizedNode(200 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -70235,7 +70106,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(202 /* FunctionExpression */); + var node = createSynthesizedNode(201 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -70259,7 +70130,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(203 /* ArrowFunction */); + var node = createSynthesizedNode(202 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -70281,7 +70152,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(204 /* DeleteExpression */); + var node = createSynthesizedNode(203 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70293,7 +70164,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(205 /* TypeOfExpression */); + var node = createSynthesizedNode(204 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70305,7 +70176,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(206 /* VoidExpression */); + var node = createSynthesizedNode(205 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70317,7 +70188,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(207 /* AwaitExpression */); + var node = createSynthesizedNode(206 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -70329,7 +70200,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(208 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(207 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -70342,7 +70213,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(209 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(208 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -70355,7 +70226,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(210 /* BinaryExpression */); + var node = createSynthesizedNode(209 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -70372,7 +70243,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(211 /* ConditionalExpression */); + var node = createSynthesizedNode(210 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(57 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -70392,7 +70263,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(212 /* TemplateExpression */); + var node = createSynthesizedNode(211 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -70489,7 +70360,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(213 /* YieldExpression */); + var node = createSynthesizedNode(212 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 41 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 41 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -70503,7 +70374,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(214 /* SpreadElement */); + var node = createSynthesizedNode(213 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -70515,7 +70386,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(215 /* ClassExpression */); + var node = createSynthesizedNode(214 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70536,11 +70407,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(216 /* OmittedExpression */); + return createSynthesizedNode(215 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(217 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(216 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -70554,7 +70425,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(218 /* AsExpression */); + var node = createSynthesizedNode(217 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -70568,19 +70439,36 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(219 /* NonNullExpression */); + var node = createSynthesizedNode(218 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } ts.createNonNullExpression = createNonNullExpression; function updateNonNullExpression(node, expression) { + if (ts.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } return node.expression !== expression ? updateNode(createNonNullExpression(expression), node) : node; } ts.updateNonNullExpression = updateNonNullExpression; + function createNonNullChain(expression) { + var node = createSynthesizedNode(218 /* NonNullExpression */); + node.flags |= 32 /* OptionalChain */; + node.expression = ts.parenthesizeForAccess(expression); + return node; + } + ts.createNonNullChain = createNonNullChain; + function updateNonNullChain(node, expression) { + ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression + ? updateNode(createNonNullChain(expression), node) + : node; + } + ts.updateNonNullChain = updateNonNullChain; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(220 /* MetaProperty */); + var node = createSynthesizedNode(219 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -70594,7 +70482,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(222 /* TemplateSpan */); + var node = createSynthesizedNode(221 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -70608,12 +70496,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(223 /* SemicolonClassElement */); + return createSynthesizedNode(222 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(224 /* Block */); + var block = createSynthesizedNode(223 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -70627,7 +70515,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(226 /* VariableStatement */); + var node = createSynthesizedNode(225 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -70642,11 +70530,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(225 /* EmptyStatement */); + return createSynthesizedNode(224 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(227 /* ExpressionStatement */); + var node = createSynthesizedNode(226 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -70662,7 +70550,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(228 /* IfStatement */); + var node = createSynthesizedNode(227 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -70678,7 +70566,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(229 /* DoStatement */); + var node = createSynthesizedNode(228 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; return node; @@ -70692,7 +70580,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(230 /* WhileStatement */); + var node = createSynthesizedNode(229 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70706,7 +70594,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(231 /* ForStatement */); + var node = createSynthesizedNode(230 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -70724,7 +70612,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(232 /* ForInStatement */); + var node = createSynthesizedNode(231 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -70740,7 +70628,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(233 /* ForOfStatement */); + var node = createSynthesizedNode(232 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = ts.isCommaSequence(expression) ? createParen(expression) : expression; @@ -70758,7 +70646,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(234 /* ContinueStatement */); + var node = createSynthesizedNode(233 /* ContinueStatement */); node.label = asName(label); return node; } @@ -70770,7 +70658,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(235 /* BreakStatement */); + var node = createSynthesizedNode(234 /* BreakStatement */); node.label = asName(label); return node; } @@ -70782,7 +70670,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(236 /* ReturnStatement */); + var node = createSynthesizedNode(235 /* ReturnStatement */); node.expression = expression; return node; } @@ -70794,7 +70682,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(237 /* WithStatement */); + var node = createSynthesizedNode(236 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); return node; @@ -70808,7 +70696,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(238 /* SwitchStatement */); + var node = createSynthesizedNode(237 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -70822,7 +70710,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(239 /* LabeledStatement */); + var node = createSynthesizedNode(238 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); return node; @@ -70836,7 +70724,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(240 /* ThrowStatement */); + var node = createSynthesizedNode(239 /* ThrowStatement */); node.expression = expression; return node; } @@ -70848,7 +70736,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(241 /* TryStatement */); + var node = createSynthesizedNode(240 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -70864,12 +70752,12 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(242 /* DebuggerStatement */); + return createSynthesizedNode(241 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { /* Internally, one should probably use createTypeScriptVariableDeclaration instead and handle definite assignment assertions */ - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70887,7 +70775,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; /* @internal */ function createTypeScriptVariableDeclaration(name, exclaimationToken, type, initializer) { - var node = createSynthesizedNode(243 /* VariableDeclaration */); + var node = createSynthesizedNode(242 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -70907,7 +70795,7 @@ var ts; ts.updateTypeScriptVariableDeclaration = updateTypeScriptVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* VariableDeclarationList */); + var node = createSynthesizedNode(243 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -70920,7 +70808,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(245 /* FunctionDeclaration */); + var node = createSynthesizedNode(244 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -70946,7 +70834,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(246 /* ClassDeclaration */); + var node = createSynthesizedNode(245 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70968,7 +70856,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(247 /* InterfaceDeclaration */); + var node = createSynthesizedNode(246 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -70990,7 +70878,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(248 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(247 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71010,7 +70898,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(249 /* EnumDeclaration */); + var node = createSynthesizedNode(248 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71029,7 +70917,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(250 /* ModuleDeclaration */); + var node = createSynthesizedNode(249 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -71048,7 +70936,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(251 /* ModuleBlock */); + var node = createSynthesizedNode(250 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -71060,7 +70948,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(252 /* CaseBlock */); + var node = createSynthesizedNode(251 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -71072,7 +70960,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(253 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(252 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -71084,7 +70972,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(254 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(253 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -71102,7 +70990,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ImportDeclaration */); + var node = createSynthesizedNode(254 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -71121,7 +71009,7 @@ var ts; ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(256 /* ImportClause */); + var node = createSynthesizedNode(255 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; node.isTypeOnly = isTypeOnly; @@ -71137,13 +71025,13 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(257 /* NamespaceImport */); + var node = createSynthesizedNode(256 /* NamespaceImport */); node.name = name; return node; } ts.createNamespaceImport = createNamespaceImport; function createNamespaceExport(name) { - var node = createSynthesizedNode(263 /* NamespaceExport */); + var node = createSynthesizedNode(262 /* NamespaceExport */); node.name = name; return node; } @@ -71161,7 +71049,7 @@ var ts; } ts.updateNamespaceExport = updateNamespaceExport; function createNamedImports(elements) { - var node = createSynthesizedNode(258 /* NamedImports */); + var node = createSynthesizedNode(257 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -71173,7 +71061,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(259 /* ImportSpecifier */); + var node = createSynthesizedNode(258 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -71187,7 +71075,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(260 /* ExportAssignment */); + var node = createSynthesizedNode(259 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -71205,7 +71093,7 @@ var ts; ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { if (isTypeOnly === void 0) { isTypeOnly = false; } - var node = createSynthesizedNode(261 /* ExportDeclaration */); + var node = createSynthesizedNode(260 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; @@ -71230,7 +71118,7 @@ var ts; } ts.createEmptyExports = createEmptyExports; function createNamedExports(elements) { - var node = createSynthesizedNode(262 /* NamedExports */); + var node = createSynthesizedNode(261 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -71242,7 +71130,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(264 /* ExportSpecifier */); + var node = createSynthesizedNode(263 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -71257,7 +71145,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(266 /* ExternalModuleReference */); + var node = createSynthesizedNode(265 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -71271,14 +71159,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(295 /* JSDocTypeExpression */); + var node = createSynthesizedNode(294 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(321 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(320 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71286,7 +71174,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(319 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(318 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -71294,14 +71182,14 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /** @internal */ function createJSDocThisTag(typeExpression) { - var tag = createJSDocTag(320 /* JSDocThisTag */, "this"); + var tag = createJSDocTag(319 /* JSDocThisTag */, "this"); tag.typeExpression = typeExpression; return tag; } ts.createJSDocThisTag = createJSDocThisTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(318 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(317 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -71311,12 +71199,12 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocClassTag() { - return createJSDocTag(311 /* JSDocClassTag */, "class"); + return createJSDocTag(310 /* JSDocClassTag */, "class"); } ts.createJSDocClassTag = createJSDocClassTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(304 /* JSDocComment */); + var node = createSynthesizedNode(303 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -71330,7 +71218,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(267 /* JsxElement */); + var node = createSynthesizedNode(266 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -71346,7 +71234,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(268 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(267 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71362,7 +71250,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(269 /* JsxOpeningElement */); + var node = createSynthesizedNode(268 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -71378,7 +71266,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(270 /* JsxClosingElement */); + var node = createSynthesizedNode(269 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -71390,7 +71278,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(271 /* JsxFragment */); + var node = createSynthesizedNode(270 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -71412,11 +71300,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(272 /* JsxOpeningFragment */); + return createSynthesizedNode(271 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(273 /* JsxClosingFragment */); + return createSynthesizedNode(272 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -71428,7 +71316,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(274 /* JsxAttribute */); + var node = createSynthesizedNode(273 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -71442,7 +71330,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(275 /* JsxAttributes */); + var node = createSynthesizedNode(274 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -71454,7 +71342,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(276 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(275 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -71466,7 +71354,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(277 /* JsxExpression */); + var node = createSynthesizedNode(276 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -71480,7 +71368,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(278 /* CaseClause */); + var node = createSynthesizedNode(277 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -71494,7 +71382,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(279 /* DefaultClause */); + var node = createSynthesizedNode(278 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -71506,7 +71394,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(280 /* HeritageClause */); + var node = createSynthesizedNode(279 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -71519,7 +71407,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(281 /* CatchClause */); + var node = createSynthesizedNode(280 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -71534,7 +71422,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(282 /* PropertyAssignment */); + var node = createSynthesizedNode(281 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -71549,7 +71437,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(283 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(282 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -71563,7 +71451,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(284 /* SpreadAssignment */); + var node = createSynthesizedNode(283 /* SpreadAssignment */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -71576,7 +71464,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(285 /* EnumMember */); + var node = createSynthesizedNode(284 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -71597,7 +71485,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(291 /* SourceFile */); + var updated = createSynthesizedNode(290 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -71681,7 +71569,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(326 /* NotEmittedStatement */); + var node = createSynthesizedNode(325 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -71693,7 +71581,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(330 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(329 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71705,7 +71593,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(329 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(328 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -71720,7 +71608,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(327 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(326 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -71736,7 +71624,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 328 /* CommaListExpression */) { + if (node.kind === 327 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -71746,7 +71634,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(328 /* CommaListExpression */); + var node = createSynthesizedNode(327 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -71759,7 +71647,7 @@ var ts; ts.updateCommaList = updateCommaList; /* @internal */ function createSyntheticReferenceExpression(expression, thisArg) { - var node = createSynthesizedNode(331 /* SyntheticReferenceExpression */); + var node = createSynthesizedNode(330 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; return node; @@ -71775,7 +71663,7 @@ var ts; ts.updateSyntheticReferenceExpression = updateSyntheticReferenceExpression; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(292 /* Bundle */); + var node = ts.createNode(291 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -71810,7 +71698,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(293 /* UnparsedSource */); + var node = ts.createNode(292 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -71945,10 +71833,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 286 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 287 /* UnparsedPrepend */; - case "internal" /* Internal */: return 289 /* UnparsedInternalText */; - case "text" /* Text */: return 288 /* UnparsedText */; + case "prologue" /* Prologue */: return 285 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 286 /* UnparsedPrepend */; + case "internal" /* Internal */: return 288 /* UnparsedInternalText */; + case "text" /* Text */: return 287 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -71966,14 +71854,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(290 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(289 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(294 /* InputFiles */); + var node = ts.createNode(293 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -72170,7 +72058,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -72717,7 +72605,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 239 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 238 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -72736,13 +72624,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -72750,7 +72638,7 @@ var ts; } function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { if (cacheIdentifiers === void 0) { cacheIdentifiers = false; } - var callee = skipOuterExpressions(expression, 7 /* All */); + var callee = skipOuterExpressions(expression, 15 /* All */); var thisArg; var target; if (ts.isSuperProperty(callee)) { @@ -72769,7 +72657,7 @@ var ts; } else { switch (callee.kind) { - case 195 /* PropertyAccessExpression */: { + case 194 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72782,7 +72670,7 @@ var ts; } break; } - case 196 /* ElementAccessExpression */: { + case 195 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -72842,14 +72730,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -73175,7 +73063,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 201 /* ParenthesizedExpression */) { + if (skipped.kind === 200 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -73209,10 +73097,10 @@ 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(210 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(210 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(209 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 203 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 202 /* ArrowFunction */ && binaryOperatorPrecedence > 3) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -73224,7 +73112,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 213 /* YieldExpression */) { + && operand.kind === 212 /* YieldExpression */) { return false; } return true; @@ -73312,7 +73200,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -73325,7 +73213,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(211 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(210 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -73360,8 +73248,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 215 /* ClassExpression */: - case 202 /* FunctionExpression */: + case 214 /* ClassExpression */: + case 201 /* FunctionExpression */: needsParens = true; } } @@ -73377,9 +73265,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 197 /* CallExpression */: + case 196 /* CallExpression */: return ts.createParen(expression); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -73402,7 +73290,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 198 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 197 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -73440,7 +73328,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(210 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(209 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -73451,29 +73339,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 202 /* FunctionExpression */ || kind === 203 /* ArrowFunction */) { + if (kind === 201 /* FunctionExpression */ || kind === 202 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); - return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); + return recreateOuterExpressions(expression, mutableCall, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 194 /* ObjectLiteralExpression */ || leftmostExpressionKind === 202 /* FunctionExpression */) { + if (leftmostExpressionKind === 193 /* ObjectLiteralExpression */ || leftmostExpressionKind === 201 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 181 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 180 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -73481,9 +73369,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 173 /* TypeQuery */: - case 185 /* TypeOperator */: - case 182 /* InferType */: + case 172 /* TypeQuery */: + case 184 /* TypeOperator */: + case 181 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -73509,28 +73397,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: node = node.operand; continue; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: node = node.left; continue; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: node = node.condition; continue; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: node = node.tag; continue; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 218 /* AsExpression */: - case 196 /* ElementAccessExpression */: - case 195 /* PropertyAccessExpression */: - case 219 /* NonNullExpression */: - case 327 /* PartiallyEmittedExpression */: + case 217 /* AsExpression */: + case 195 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 218 /* NonNullExpression */: + case 326 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -73539,71 +73427,61 @@ var ts; } ts.getLeftmostExpression = getLeftmostExpression; function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 194 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 193 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 210 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 328 /* CommaListExpression */; + return node.kind === 209 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 327 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; (function (OuterExpressionKinds) { OuterExpressionKinds[OuterExpressionKinds["Parentheses"] = 1] = "Parentheses"; - OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 2] = "Assertions"; - OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 4] = "PartiallyEmittedExpressions"; - OuterExpressionKinds[OuterExpressionKinds["All"] = 7] = "All"; + OuterExpressionKinds[OuterExpressionKinds["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds[OuterExpressionKinds["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds[OuterExpressionKinds["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds[OuterExpressionKinds["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds[OuterExpressionKinds["All"] = 15] = "All"; })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {})); function isOuterExpression(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: - case 219 /* NonNullExpression */: - return (kinds & 2 /* Assertions */) !== 0; - case 327 /* PartiallyEmittedExpression */: - return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: + return (kinds & 2 /* TypeAssertions */) !== 0; + case 218 /* NonNullExpression */: + return (kinds & 4 /* NonNullAssertions */) !== 0; + case 326 /* PartiallyEmittedExpression */: + return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; } ts.isOuterExpression = isOuterExpression; function skipOuterExpressions(node, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } - var previousNode; - do { - previousNode = node; - if (kinds & 1 /* Parentheses */) { - node = ts.skipParentheses(node); - } - if (kinds & 2 /* Assertions */) { - node = skipAssertions(node); - } - if (kinds & 4 /* PartiallyEmittedExpressions */) { - node = ts.skipPartiallyEmittedExpressions(node); - } - } while (previousNode !== node); - return node; - } - ts.skipOuterExpressions = skipOuterExpressions; - function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 219 /* NonNullExpression */) { + if (kinds === void 0) { kinds = 15 /* All */; } + while (isOuterExpression(node, kinds)) { node = node.expression; } return node; } + ts.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions(node, 6 /* Assertions */); + } ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 201 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 200 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 218 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 219 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 327 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 200 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 217 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -73621,7 +73499,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 201 /* ParenthesizedExpression */ + return node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -73629,7 +73507,7 @@ var ts; && !ts.some(ts.getSyntheticTrailingComments(node)); } function recreateOuterExpressions(outerExpression, innerExpression, kinds) { - if (kinds === void 0) { kinds = 7 /* All */; } + if (kinds === void 0) { kinds = 15 /* All */; } if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { return updateOuterExpression(outerExpression, recreateOuterExpressions(outerExpression.expression, innerExpression)); } @@ -73739,10 +73617,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 255 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 254 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 261 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 260 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -73861,7 +73739,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -73873,11 +73751,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -73909,12 +73787,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 157 /* Parameter */: - case 192 /* BindingElement */: + case 156 /* Parameter */: + case 191 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 214 /* SpreadElement */: - case 284 /* SpreadAssignment */: + case 213 /* SpreadElement */: + case 283 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -73932,7 +73810,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 192 /* BindingElement */: + case 191 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -73947,7 +73825,7 @@ var ts; : propertyName; } break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -73962,7 +73840,7 @@ var ts; : propertyName; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -73985,13 +73863,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -74031,11 +73909,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 191 /* ArrayBindingPattern */: - case 193 /* ArrayLiteralExpression */: + case 190 /* ArrayBindingPattern */: + case 192 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 190 /* ObjectBindingPattern */: - case 194 /* ObjectLiteralExpression */: + case 189 /* ObjectBindingPattern */: + case 193 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -74194,289 +74072,289 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */) || kind === 184 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */) || kind === 183 /* ThisType */) { return node; } switch (kind) { // Names case 75 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 157 /* Parameter */: + case 156 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 158 /* Decorator */: + case 157 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 163 /* Constructor */: + case 162 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return ts.updateTypePredicateNodeWithModifier(node, visitNode(node.assertsModifier, visitor), visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 176 /* TupleType */: + case 175 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 178 /* RestType */: + case 177 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* UnionType */: + case 178 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 182 /* InferType */: + case 181 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 189 /* ImportType */: + case 188 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 187 /* MappedType */: + case 186 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updatePropertyAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier)); } return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateElementAccessChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), visitNode(node.argumentExpression, visitor, ts.isExpression)); } return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return ts.updateCallChain(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, tokenVisitor, ts.isToken)); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, tokenVisitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 218 /* AsExpression */: + case 217 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 224 /* Block */: + case 223 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 231 /* ForStatement */: + case 230 /* ForStatement */: 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, ts.liftToBlock)); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, tokenVisitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return ts.updateTypeScriptVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings), node.isTypeOnly); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return ts.updateNamespaceExport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExportBindings), visitNode(node.moduleSpecifier, visitor, ts.isExpression), node.isTypeOnly); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 269 /* JsxOpeningElement */: + case 268 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -74519,58 +74397,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 153 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 152 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 169 /* TypePredicate */ && kind <= 188 /* LiteralType */)) { + if ((kind >= 168 /* TypePredicate */ && kind <= 187 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 223 /* SemicolonClassElement */: - case 225 /* EmptyStatement */: - case 216 /* OmittedExpression */: - case 242 /* DebuggerStatement */: - case 326 /* NotEmittedStatement */: + case 222 /* SemicolonClassElement */: + case 224 /* EmptyStatement */: + case 215 /* OmittedExpression */: + case 241 /* DebuggerStatement */: + case 325 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 157 /* Parameter */: + case 156 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 158 /* Decorator */: + case 157 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74579,12 +74457,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 163 /* Constructor */: + case 162 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74592,7 +74470,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74600,50 +74478,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 192 /* BindingElement */: + case 191 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 198 /* NewExpression */: + case 197 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -74651,123 +74529,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 201 /* ParenthesizedExpression */: - case 204 /* DeleteExpression */: - case 205 /* TypeOfExpression */: - case 206 /* VoidExpression */: - case 207 /* AwaitExpression */: - case 213 /* YieldExpression */: - case 214 /* SpreadElement */: - case 219 /* NonNullExpression */: + case 200 /* ParenthesizedExpression */: + case 203 /* DeleteExpression */: + case 204 /* TypeOfExpression */: + case 205 /* VoidExpression */: + case 206 /* AwaitExpression */: + case 212 /* YieldExpression */: + case 213 /* SpreadElement */: + case 218 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 218 /* AsExpression */: + case 217 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 224 /* Block */: + case 223 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 229 /* DoStatement */: + case 228 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 230 /* WhileStatement */: - case 237 /* WithStatement */: + case 229 /* WhileStatement */: + case 236 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 231 /* ForStatement */: + case 230 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 236 /* ReturnStatement */: - case 240 /* ThrowStatement */: + case 235 /* ReturnStatement */: + case 239 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74776,7 +74654,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -74784,143 +74662,143 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: result = reduceNode(node.name, cbNode, result); break; - case 258 /* NamedImports */: - case 262 /* NamedExports */: + case 257 /* NamedImports */: + case 261 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 259 /* ImportSpecifier */: - case 264 /* ExportSpecifier */: + case 258 /* ImportSpecifier */: + case 263 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 270 /* JsxClosingElement */: + case 269 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 291 /* SourceFile */: + case 290 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -74993,7 +74871,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 217 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 216 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -75667,7 +75545,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 291 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 290 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -75718,7 +75596,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -75731,13 +75609,13 @@ var ts; hasImportDefault = true; } break; - case 254 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 266 /* ExternalModuleReference */) { + case 253 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 265 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -75768,13 +75646,13 @@ var ts; } } break; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -75782,7 +75660,7 @@ var ts; } } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -75802,7 +75680,7 @@ var ts; } } break; - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -75981,7 +75859,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 160 /* PropertyDeclaration */ + return member.kind === 159 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -76610,8 +76488,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -76637,14 +76515,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -76695,16 +76573,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 291 /* SourceFile */: - case 252 /* CaseBlock */: - case 251 /* ModuleBlock */: - case 224 /* Block */: + case 290 /* SourceFile */: + case 251 /* CaseBlock */: + case 250 /* ModuleBlock */: + case 223 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 246 /* ClassDeclaration */: - case 245 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 244 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -76716,7 +76594,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 246 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 245 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -76759,10 +76637,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 260 /* ExportAssignment */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 259 /* ExportAssignment */: + case 260 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -76783,13 +76661,13 @@ var ts; return node; } switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -76809,11 +76687,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 261 /* ExportDeclaration */ || - node.kind === 255 /* ImportDeclaration */ || - node.kind === 256 /* ImportClause */ || - (node.kind === 254 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 266 /* ExternalModuleReference */)) { + if (node.kind === 260 /* ExportDeclaration */ || + node.kind === 254 /* ImportDeclaration */ || + node.kind === 255 /* ImportClause */ || + (node.kind === 253 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 265 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -76837,19 +76715,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 168 /* IndexSignature */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 167 /* IndexSignature */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -76885,62 +76763,62 @@ var ts; case 118 /* ProtectedKeyword */: case 122 /* AbstractKeyword */: case 81 /* ConstKeyword */: - case 131 /* DeclareKeyword */: - case 139 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 175 /* ArrayType */: - case 176 /* TupleType */: - case 177 /* OptionalType */: - case 178 /* RestType */: - case 174 /* TypeLiteral */: - case 169 /* TypePredicate */: - case 156 /* TypeParameter */: + case 174 /* ArrayType */: + case 175 /* TupleType */: + case 176 /* OptionalType */: + case 177 /* RestType */: + case 173 /* TypeLiteral */: + case 168 /* TypePredicate */: + case 155 /* TypeParameter */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 129 /* BooleanKeyword */: - case 144 /* StringKeyword */: - case 141 /* NumberKeyword */: - case 138 /* NeverKeyword */: + case 148 /* UnknownKeyword */: + case 128 /* BooleanKeyword */: + case 143 /* StringKeyword */: + case 140 /* NumberKeyword */: + case 137 /* NeverKeyword */: case 110 /* VoidKeyword */: - case 145 /* SymbolKeyword */: - case 172 /* ConstructorType */: - case 171 /* FunctionType */: - case 173 /* TypeQuery */: - case 170 /* TypeReference */: - case 179 /* UnionType */: - case 180 /* IntersectionType */: - case 181 /* ConditionalType */: - case 183 /* ParenthesizedType */: - case 184 /* ThisType */: - case 185 /* TypeOperator */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 188 /* LiteralType */: + case 144 /* SymbolKeyword */: + case 171 /* ConstructorType */: + case 170 /* FunctionType */: + case 172 /* TypeQuery */: + case 169 /* TypeReference */: + case 178 /* UnionType */: + case 179 /* IntersectionType */: + case 180 /* ConditionalType */: + case 182 /* ParenthesizedType */: + case 183 /* ThisType */: + case 184 /* TypeOperator */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 187 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 158 /* Decorator */: + case 157 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 163 /* Constructor */: + case 162 /* Constructor */: return visitConstructor(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76950,7 +76828,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -76960,35 +76838,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -76998,35 +76876,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 200 /* TypeAssertionExpression */: - case 218 /* AsExpression */: + case 199 /* TypeAssertionExpression */: + case 217 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -77439,12 +77317,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -77597,7 +77475,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 160 /* PropertyDeclaration */ + ? member.kind === 159 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -77720,10 +77598,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */ - || kind === 160 /* PropertyDeclaration */; + return kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */ + || kind === 159 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -77733,7 +77611,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 162 /* MethodDeclaration */; + return node.kind === 161 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -77744,12 +77622,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return true; } return false; @@ -77766,15 +77644,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 157 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 156 /* Parameter */: return serializeTypeNode(node.type); - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -77811,7 +77689,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 164 /* GetAccessor */) { + if (container && node.kind === 163 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -77857,30 +77735,30 @@ var ts; } switch (node.kind) { case 110 /* VoidKeyword */: - case 147 /* UndefinedKeyword */: + case 146 /* UndefinedKeyword */: case 100 /* NullKeyword */: - case 138 /* NeverKeyword */: + case 137 /* NeverKeyword */: return ts.createVoidZero(); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 171 /* FunctionType */: - case 172 /* ConstructorType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: return ts.createIdentifier("Function"); - case 175 /* ArrayType */: - case 176 /* TupleType */: + case 174 /* ArrayType */: + case 175 /* TupleType */: return ts.createIdentifier("Array"); - case 169 /* TypePredicate */: - case 129 /* BooleanKeyword */: + case 168 /* TypePredicate */: + case 128 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 144 /* StringKeyword */: + case 143 /* StringKeyword */: return ts.createIdentifier("String"); - case 142 /* ObjectKeyword */: + case 141 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 188 /* LiteralType */: + case 187 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -77891,34 +77769,34 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 141 /* NumberKeyword */: + case 140 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 152 /* BigIntKeyword */: + case 151 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 145 /* SymbolKeyword */: + case 144 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return serializeTypeReferenceNode(node); - case 180 /* IntersectionType */: - case 179 /* UnionType */: + case 179 /* IntersectionType */: + case 178 /* UnionType */: return serializeTypeList(node.types); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 185 /* TypeOperator */: - if (node.operator === 139 /* ReadonlyKeyword */) { + case 184 /* TypeOperator */: + if (node.operator === 138 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 173 /* TypeQuery */: - case 186 /* IndexedAccessType */: - case 187 /* MappedType */: - case 174 /* TypeLiteral */: + case 172 /* TypeQuery */: + case 185 /* IndexedAccessType */: + case 186 /* MappedType */: + case 173 /* TypeLiteral */: case 125 /* AnyKeyword */: - case 149 /* UnknownKeyword */: - case 184 /* ThisType */: - case 189 /* ImportType */: + case 148 /* UnknownKeyword */: + case 183 /* ThisType */: + case 188 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -77931,13 +77809,13 @@ var ts; var serializedUnion; for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { var typeNode = types_20[_i]; - while (typeNode.kind === 183 /* ParenthesizedType */) { + while (typeNode.kind === 182 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 138 /* NeverKeyword */) { + if (typeNode.kind === 137 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 147 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 100 /* NullKeyword */ || typeNode.kind === 146 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -78046,7 +77924,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -78366,7 +78244,7 @@ var ts; /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)); } function visitParenthesizedExpression(node) { - var innerExpression = ts.skipOuterExpressions(node.expression, ~2 /* Assertions */); + var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */); if (ts.isAssertionExpression(innerExpression)) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; @@ -78606,12 +78484,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 291 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 290 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 249 /* EnumDeclaration */) { + if (node.kind === 248 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -78736,7 +78614,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 251 /* ModuleBlock */) { + if (body.kind === 250 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -78782,13 +78660,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 251 /* ModuleBlock */) { + if (body.kind !== 250 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 250 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 249 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -78838,7 +78716,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 257 /* NamespaceImport */) { + if (node.kind === 256 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -79086,16 +78964,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(75 /* Identifier */); - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(250 /* ModuleDeclaration */); + context.enableEmitNotification(249 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 250 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 249 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 249 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 248 /* EnumDeclaration */; } /** * Hook for node emit. @@ -79156,9 +79034,9 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -79196,9 +79074,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 291 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 250 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 249 /* EnumDeclaration */); + if (container && container.kind !== 290 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 249 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 248 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -79349,40 +79227,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 215 /* ClassExpression */: - case 246 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 245 /* ClassDeclaration */: return visitClassLike(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); case 76 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 194 /* ObjectLiteralExpression */: - case 193 /* ArrayLiteralExpression */: + case 193 /* ObjectLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -79405,20 +79283,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 162 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 161 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -80184,31 +80062,31 @@ var ts; case 126 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 163 /* Constructor */: - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 162 /* Constructor */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80217,27 +80095,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 224 /* Block */: - case 238 /* SwitchStatement */: - case 252 /* CaseBlock */: - case 278 /* CaseClause */: - case 279 /* DefaultClause */: - case 241 /* TryStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: - case 228 /* IfStatement */: - case 237 /* WithStatement */: - case 239 /* LabeledStatement */: + case 223 /* Block */: + case 237 /* SwitchStatement */: + case 251 /* CaseBlock */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: + case 240 /* TryStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: + case 227 /* IfStatement */: + case 236 /* WithStatement */: + case 238 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -80442,7 +80320,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 203 /* ArrowFunction */; + var isArrowFunction = node.kind === 202 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -80533,17 +80411,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -80591,11 +80469,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -80627,11 +80505,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -80799,64 +80677,64 @@ var ts; return node; } switch (node.kind) { - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return visitAwaitExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return visitVoidExpression(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return doWithLexicalThis(visitConstructorDeclaration, node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return doWithLexicalThis(visitMethodDeclaration, node); - case 164 /* GetAccessor */: + case 163 /* GetAccessor */: return doWithLexicalThis(visitGetAccessorDeclaration, node); - case 165 /* SetAccessor */: + case 164 /* SetAccessor */: return doWithLexicalThis(visitSetAccessorDeclaration, node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return doWithLexicalThis(visitFunctionDeclaration, node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return doWithLexicalThis(visitFunctionExpression, node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 102 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 102 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: return doWithLexicalThis(visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -80890,7 +80768,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 233 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 232 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -80902,7 +80780,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 284 /* SpreadAssignment */) { + if (e.kind === 283 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -80911,7 +80789,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 282 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 281 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -80945,7 +80823,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 194 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 193 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } var expression = objects[0]; @@ -81323,17 +81201,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(197 /* CallExpression */); - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(196 /* ElementAccessExpression */); + context.enableSubstitution(196 /* CallExpression */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(195 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(246 /* ClassDeclaration */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(163 /* Constructor */); + context.enableEmitNotification(245 /* ClassDeclaration */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(162 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(226 /* VariableStatement */); + context.enableEmitNotification(225 /* VariableStatement */); } } /** @@ -81381,11 +81259,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -81417,11 +81295,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 246 /* ClassDeclaration */ - || kind === 163 /* Constructor */ - || kind === 162 /* MethodDeclaration */ - || kind === 164 /* GetAccessor */ - || kind === 165 /* SetAccessor */; + return kind === 245 /* ClassDeclaration */ + || kind === 162 /* Constructor */ + || kind === 161 /* MethodDeclaration */ + || kind === 163 /* GetAccessor */ + || kind === 164 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -81519,7 +81397,7 @@ var ts; return node; } switch (node.kind) { - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -81551,30 +81429,32 @@ var ts; return node; } switch (node.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: - case 197 /* CallExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: + case 196 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); } } function flattenChain(chain) { + ts.Debug.assertNotNode(chain, ts.isNonNullChain); var links = [chain]; while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) { - chain = ts.cast(chain.expression, ts.isOptionalChain); + chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain); + ts.Debug.assertNotNode(chain, ts.isNonNullChain); links.unshift(chain); } return { expression: chain.expression, chain: links }; @@ -81605,7 +81485,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 195 /* PropertyAccessExpression */ + expression = node.kind === 194 /* PropertyAccessExpression */ ? ts.updatePropertyAccess(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : ts.updateElementAccess(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? ts.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -81619,10 +81499,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 201 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 197 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 200 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 196 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -81641,8 +81521,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 195 /* PropertyAccessExpression */: - case 196 /* ElementAccessExpression */: + case 194 /* PropertyAccessExpression */: + case 195 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (shouldCaptureInTempVariable(rightExpression)) { thisArg = ts.createTempVariable(hoistVariableDeclaration); @@ -81652,11 +81532,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 195 /* PropertyAccessExpression */ + rightExpression = segment.kind === 194 /* PropertyAccessExpression */ ? ts.createPropertyAccess(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : ts.createElementAccess(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 197 /* CallExpression */: + case 196 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = ts.createFunctionCall(rightExpression, leftThisArg.kind === 102 /* SuperKeyword */ ? ts.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -81754,13 +81634,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -81770,13 +81650,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return visitJsxExpression(node); - case 267 /* JsxElement */: + case 266 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -81851,7 +81731,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 277 /* JsxExpression */) { + else if (node.kind === 276 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -81945,7 +81825,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 267 /* JsxElement */) { + if (node.kind === 266 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -82251,7 +82131,7 @@ var ts; return node; } switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -82464,13 +82344,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 236 /* ReturnStatement */ + && node.kind === 235 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 256 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 224 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 223 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -82492,63 +82372,63 @@ var ts; switch (node.kind) { case 120 /* StaticKeyword */: return undefined; // elide static keyword - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return visitClassExpression(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return visitParameter(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return visitArrowFunction(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return visitVariableDeclaration(node); case 75 /* Identifier */: return visitIdentifier(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 235 /* BreakStatement */: - case 234 /* ContinueStatement */: + case 234 /* BreakStatement */: + case 233 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return visitExpressionStatement(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -82559,28 +82439,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return visitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return visitSpreadElement(node); case 102 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 104 /* ThisKeyword */: return visitThisKeyword(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return visitMetaProperty(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -82671,14 +82551,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 235 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 234 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -82689,7 +82569,7 @@ var ts; } } else { - if (node.kind === 235 /* BreakStatement */) { + if (node.kind === 234 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -83085,11 +82965,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 236 /* ReturnStatement */) { + if (statement.kind === 235 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 228 /* IfStatement */) { + else if (statement.kind === 227 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -83097,7 +82977,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 224 /* Block */) { + else if (statement.kind === 223 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -83295,7 +83175,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 203 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 202 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -83316,22 +83196,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return statements; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 245 /* FunctionDeclaration */: - case 202 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 201 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 98 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -83363,20 +83243,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 163 /* Constructor */: + case 162 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -83578,7 +83458,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 245 /* FunctionDeclaration */ || node.kind === 202 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 244 /* FunctionDeclaration */ || node.kind === 201 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -83622,7 +83502,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 203 /* ArrowFunction */); + ts.Debug.assert(node.kind === 202 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -83690,9 +83570,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -83711,9 +83591,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -83927,14 +83807,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -84122,7 +84002,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 155 /* ComputedPropertyName */) { + if (property.name.kind === 154 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -84243,11 +84123,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 231 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 232 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 233 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 229 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 230 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 230 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 231 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 232 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 228 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 229 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -84272,11 +84152,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 231 /* ForStatement */: - case 232 /* ForInStatement */: - case 233 /* ForOfStatement */: + case 230 /* ForStatement */: + case 231 /* ForInStatement */: + case 232 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 244 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 243 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -84675,20 +84555,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -84795,7 +84675,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 164 /* GetAccessor */) { + if (node.kind === 163 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -85287,13 +85167,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(104 /* ThisKeyword */); - context.enableEmitNotification(163 /* Constructor */); - context.enableEmitNotification(162 /* MethodDeclaration */); - context.enableEmitNotification(164 /* GetAccessor */); - context.enableEmitNotification(165 /* SetAccessor */); - context.enableEmitNotification(203 /* ArrowFunction */); - context.enableEmitNotification(202 /* FunctionExpression */); - context.enableEmitNotification(245 /* FunctionDeclaration */); + context.enableEmitNotification(162 /* Constructor */); + context.enableEmitNotification(161 /* MethodDeclaration */); + context.enableEmitNotification(163 /* GetAccessor */); + context.enableEmitNotification(164 /* SetAccessor */); + context.enableEmitNotification(202 /* ArrowFunction */); + context.enableEmitNotification(201 /* FunctionExpression */); + context.enableEmitNotification(244 /* FunctionDeclaration */); } } /** @@ -85334,10 +85214,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: - case 249 /* EnumDeclaration */: - case 243 /* VariableDeclaration */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: + case 248 /* EnumDeclaration */: + case 242 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -85419,11 +85299,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 227 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 226 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 197 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 196 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -85431,7 +85311,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 214 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 213 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -85471,15 +85351,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(269 /* JsxOpeningElement */); - context.enableEmitNotification(270 /* JsxClosingElement */); - context.enableEmitNotification(268 /* JsxSelfClosingElement */); + context.enableEmitNotification(268 /* JsxOpeningElement */); + context.enableEmitNotification(269 /* JsxClosingElement */); + context.enableEmitNotification(267 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(195 /* PropertyAccessExpression */); - context.enableSubstitution(282 /* PropertyAssignment */); + context.enableSubstitution(194 /* PropertyAccessExpression */); + context.enableSubstitution(281 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -85498,9 +85378,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 269 /* JsxOpeningElement */: - case 270 /* JsxClosingElement */: - case 268 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 269 /* JsxClosingElement */: + case 267 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -85835,13 +85715,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -85854,24 +85734,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return visitAccessorDeclaration(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return visitBreakStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return visitContinueStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -85892,21 +85772,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return visitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return visitConditionalExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return visitYieldExpression(node); - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return visitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -85919,9 +85799,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -86129,7 +86009,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -86141,7 +86021,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -86517,35 +86397,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: return transformAndEmitBlock(node); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return transformAndEmitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return transformAndEmitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return transformAndEmitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return transformAndEmitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -86975,7 +86855,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 279 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 278 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -86988,7 +86868,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 278 /* CaseClause */) { + if (clause.kind === 277 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -88217,11 +88097,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -88545,23 +88425,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -88588,24 +88468,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -89105,7 +88985,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -89160,10 +89040,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -89376,7 +89256,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -89440,10 +89320,10 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 209 /* PostfixUnaryExpression */: - case 208 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -89464,7 +89344,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -89539,7 +89419,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -89638,12 +89518,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(75 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(283 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(210 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(208 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(209 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(220 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(291 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(282 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(209 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(207 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(208 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(219 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(290 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -89867,7 +89747,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 261 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 260 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -89892,7 +89772,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 261 /* ExportDeclaration */) { + if (externalImport.kind !== 260 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -89975,19 +89855,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -90046,13 +89926,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return visitImportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return visitExportDeclaration(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -90232,7 +90112,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 291 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 290 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -90296,7 +90176,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 226 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 225 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -90358,10 +90238,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -90541,43 +90421,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return visitVariableStatement(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return visitClassDeclaration(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return visitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return visitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return visitForOfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return visitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return visitWhileStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return visitLabeledStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return visitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return visitSwitchStatement(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return visitCaseBlock(node); - case 278 /* CaseClause */: + case 277 /* CaseClause */: return visitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return visitDefaultClause(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return visitTryStatement(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return visitCatchClause(node); - case 224 /* Block */: + case 223 /* Block */: return visitBlock(node); - case 329 /* MergeDeclarationMarker */: + case 328 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 330 /* EndOfDeclarationMarker */: + case 329 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -90824,7 +90704,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 291 /* SourceFile */; + return container !== undefined && container.kind === 290 /* SourceFile */; } else { return false; @@ -90857,7 +90737,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 291 /* SourceFile */) { + if (node.kind === 290 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -90907,7 +90787,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -90943,12 +90823,12 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return substituteBinaryExpression(node); - case 208 /* PrefixUnaryExpression */: - case 209 /* PostfixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -91041,14 +90921,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 209 /* PostfixUnaryExpression */ + var expression = node.kind === 208 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 209 /* PostfixUnaryExpression */) { + if (node.kind === 208 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -91076,7 +90956,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 291 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 290 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -91115,7 +90995,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(291 /* SourceFile */); + context.enableEmitNotification(290 /* SourceFile */); context.enableSubstitution(75 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(transformSourceFile); @@ -91140,12 +91020,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return visitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -91276,7 +91156,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91305,7 +91185,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91352,7 +91232,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91361,8 +91241,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 160 /* PropertyDeclaration */ || node.kind === 195 /* PropertyAccessExpression */ || node.kind === 159 /* PropertySignature */ || - (node.kind === 157 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 159 /* PropertyDeclaration */ || node.kind === 194 /* PropertyAccessExpression */ || node.kind === 158 /* PropertySignature */ || + (node.kind === 156 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -91371,7 +91251,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 === 246 /* ClassDeclaration */ || node.kind === 157 /* Parameter */) { + else if (node.parent.kind === 245 /* ClassDeclaration */ || node.kind === 156 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91396,7 +91276,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(node, 32 /* Static */)) { @@ -91435,26 +91315,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have return types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have return types that cannot be named 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 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91462,7 +91342,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 === 246 /* ClassDeclaration */) { + else if (node.parent.kind === 245 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91476,7 +91356,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -91501,30 +91381,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 163 /* Constructor */: + case 162 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 167 /* ConstructSignature */: - case 172 /* ConstructorType */: + case 166 /* ConstructSignature */: + case 171 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named 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 166 /* CallSignature */: + case 165 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named 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 168 /* IndexSignature */: + case 167 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -91532,7 +91412,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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91545,15 +91425,15 @@ 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 245 /* FunctionDeclaration */: - case 171 /* FunctionType */: + case 244 /* FunctionDeclaration */: + case 170 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 165 /* SetAccessor */: - case 164 /* GetAccessor */: + case 164 /* SetAccessor */: + case 163 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -91567,39 +91447,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 187 /* MappedType */: + case 186 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 172 /* ConstructorType */: - case 167 /* ConstructSignature */: + case 171 /* ConstructorType */: + case 166 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 166 /* CallSignature */: + case 165 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 162 /* MethodDeclaration */: - case 161 /* MethodSignature */: + case 161 /* MethodDeclaration */: + case 160 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { 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 === 246 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 245 /* ClassDeclaration */) { 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 171 /* FunctionType */: - case 245 /* FunctionDeclaration */: + case 170 /* FunctionType */: + case 244 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -91614,7 +91494,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 246 /* ClassDeclaration */) { + if (node.parent.parent.kind === 245 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 113 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -91665,7 +91545,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 157 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 156 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -91824,10 +91704,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 291 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 290 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 292 /* Bundle */) { + if (node.kind === 291 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -91850,14 +91730,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(131 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(130 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.isSourceFileJS(sourceFile) ? ts.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 294 /* InputFiles */) { + if (prepend.kind === 293 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -91998,7 +91878,7 @@ var ts; return name; } else { - if (name.kind === 191 /* ArrayBindingPattern */) { + if (name.kind === 190 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -92006,7 +91886,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 216 /* OmittedExpression */) { + if (elem.kind === 215 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -92044,7 +91924,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 157 /* Parameter */ && + var shouldUseResolverType = node.kind === 156 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -92053,7 +91933,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(125 /* AnyKeyword */); } - if (node.kind === 165 /* SetAccessor */) { + if (node.kind === 164 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return ts.createKeywordTypeNode(125 /* AnyKeyword */); @@ -92064,12 +91944,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 243 /* VariableDeclaration */ || node.kind === 192 /* BindingElement */) { + if (node.kind === 242 /* VariableDeclaration */ || node.kind === 191 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 157 /* Parameter */ - || node.kind === 160 /* PropertyDeclaration */ - || node.kind === 159 /* PropertySignature */) { + if (node.kind === 156 /* Parameter */ + || node.kind === 159 /* PropertyDeclaration */ + || node.kind === 158 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -92086,20 +91966,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 254 /* ImportEqualsDeclaration */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 253 /* ImportEqualsDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return false; } return false; @@ -92180,7 +92060,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 250 /* ModuleDeclaration */ && parent.kind !== 189 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 249 /* ModuleDeclaration */ && parent.kind !== 188 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -92200,7 +92080,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 266 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 265 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -92227,7 +92107,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 257 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 256 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings, decl.importClause.isTypeOnly), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -92316,7 +92196,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 174 /* TypeLiteral */ || input.kind === 187 /* MappedType */) && input.parent.kind !== 248 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 173 /* TypeLiteral */ || input.kind === 186 /* MappedType */) && input.parent.kind !== 247 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasModifier(input, 8 /* Private */)) { @@ -92337,38 +92217,38 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 217 /* ExpressionWithTypeArguments */: { + case 216 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 170 /* TypeReference */: { + case 169 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 163 /* Constructor */: { + case 162 /* Constructor */: { // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(163 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), + var ctor = ts.createSignatureDeclaration(162 /* Constructor */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 162 /* MethodDeclaration */: { + case 161 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } - var sig = ts.createSignatureDeclaration(161 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + var sig = ts.createSignatureDeclaration(160 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 164 /* GetAccessor */: { + case 163 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92377,7 +92257,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 165 /* SetAccessor */: { + case 164 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -92385,31 +92265,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 161 /* MethodSignature */: { + case 160 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 166 /* CallSignature */: { + case 165 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 168 /* IndexSignature */: { + case 167 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(125 /* AnyKeyword */))); } - case 243 /* VariableDeclaration */: { + case 242 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -92417,13 +92297,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(ts.updateTypeScriptVariableDeclaration(input, input.name, /*exclaimationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 156 /* TypeParameter */: { + case 155 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 181 /* ConditionalType */: { + case 180 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -92435,13 +92315,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 171 /* FunctionType */: { + case 170 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 172 /* ConstructorType */: { + case 171 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 189 /* ImportType */: { + case 188 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -92470,7 +92350,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 162 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 161 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -92480,7 +92360,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 261 /* ExportDeclaration */: { + case 260 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -92490,7 +92370,7 @@ var ts; return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), input.isTypeOnly); } - case 260 /* ExportAssignment */: { + case 259 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -92506,7 +92386,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -92531,10 +92411,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 254 /* ImportEqualsDeclaration */: { + case 253 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 255 /* ImportDeclaration */: { + case 254 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -92555,14 +92435,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 248 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 247 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 247 /* InterfaceDeclaration */: { + case 246 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 245 /* FunctionDeclaration */: { + case 244 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -92610,10 +92490,10 @@ var ts; return clean; } } - case 250 /* ModuleDeclaration */: { + case 249 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 251 /* ModuleBlock */) { + if (inner && inner.kind === 250 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -92656,7 +92536,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 246 /* ClassDeclaration */: { + case 245 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -92717,7 +92597,7 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(131 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(130 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { if (clause.token === 90 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; @@ -92737,10 +92617,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 226 /* VariableStatement */: { + case 225 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 249 /* EnumDeclaration */: { + case 248 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -92759,7 +92639,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 250 /* ModuleDeclaration */) { + if (input.kind === 249 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -92780,7 +92660,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 216 /* OmittedExpression */) { + if (e.kind === 215 /* OmittedExpression */) { return; } if (e.name) { @@ -92830,7 +92710,7 @@ var ts; function ensureModifierFlags(node) { var mask = 3071 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 291 /* SourceFile */; + var parentIsFile = node.parent.kind === 290 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -92859,7 +92739,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 247 /* InterfaceDeclaration */) { + if (node.kind === 246 /* InterfaceDeclaration */) { return true; } return false; @@ -92884,7 +92764,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 164 /* GetAccessor */ + return accessor.kind === 163 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -92893,52 +92773,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 157 /* Parameter */: - case 243 /* VariableDeclaration */: + case 156 /* Parameter */: + case 242 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 245 /* FunctionDeclaration */: - case 250 /* ModuleDeclaration */: - case 254 /* ImportEqualsDeclaration */: - case 247 /* InterfaceDeclaration */: - case 246 /* ClassDeclaration */: - case 248 /* TypeAliasDeclaration */: - case 249 /* EnumDeclaration */: - case 226 /* VariableStatement */: - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 249 /* ModuleDeclaration */: + case 253 /* ImportEqualsDeclaration */: + case 246 /* InterfaceDeclaration */: + case 245 /* ClassDeclaration */: + case 247 /* TypeAliasDeclaration */: + case 248 /* EnumDeclaration */: + case 225 /* VariableStatement */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: + case 259 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 167 /* ConstructSignature */: - case 163 /* Constructor */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 160 /* PropertyDeclaration */: - case 159 /* PropertySignature */: - case 161 /* MethodSignature */: - case 166 /* CallSignature */: - case 168 /* IndexSignature */: - case 243 /* VariableDeclaration */: - case 156 /* TypeParameter */: - case 217 /* ExpressionWithTypeArguments */: - case 170 /* TypeReference */: - case 181 /* ConditionalType */: - case 171 /* FunctionType */: - case 172 /* ConstructorType */: - case 189 /* ImportType */: + case 166 /* ConstructSignature */: + case 162 /* Constructor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 159 /* PropertyDeclaration */: + case 158 /* PropertySignature */: + case 160 /* MethodSignature */: + case 165 /* CallSignature */: + case 167 /* IndexSignature */: + case 242 /* VariableDeclaration */: + case 155 /* TypeParameter */: + case 216 /* ExpressionWithTypeArguments */: + case 169 /* TypeReference */: + case 180 /* ConditionalType */: + case 170 /* FunctionType */: + case 171 /* ConstructorType */: + case 188 /* ImportType */: return true; } return false; @@ -93071,7 +92951,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(332 /* Count */); + var enabledSyntaxKindFeatures = new Array(331 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -93435,7 +93315,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 292 /* Bundle */) { + if (sourceFile.kind === 291 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -93765,7 +93645,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 291 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 290 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -93788,8 +93668,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 292 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 291 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 291 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 290 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -93830,7 +93710,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 291 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 290 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -93941,7 +93821,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(291 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(290 /* SourceFile */, 0, 0); sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -93953,7 +93833,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(227 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(226 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -94131,9 +94011,9 @@ var ts; break; } switch (node.kind) { - case 291 /* SourceFile */: return printFile(node); - case 292 /* Bundle */: return printBundle(node); - case 293 /* UnparsedSource */: return printUnparsedSource(node); + case 290 /* SourceFile */: return printFile(node); + case 291 /* Bundle */: return printBundle(node); + case 292 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -94389,12 +94269,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 291 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 290 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 291 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 290 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -94436,15 +94316,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 293 /* UnparsedSource */: - case 287 /* UnparsedPrepend */: + case 292 /* UnparsedSource */: + case 286 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 286 /* UnparsedPrologue */: + case 285 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 288 /* UnparsedText */: - case 289 /* UnparsedInternalText */: + case 287 /* UnparsedText */: + case 288 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 290 /* UnparsedSyntheticReference */: + case 289 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 75 /* Identifier */: @@ -94454,260 +94334,260 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 154 /* QualifiedName */: + case 153 /* QualifiedName */: return emitQualifiedName(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 156 /* TypeParameter */: + case 155 /* TypeParameter */: return emitTypeParameter(node); - case 157 /* Parameter */: + case 156 /* Parameter */: return emitParameter(node); - case 158 /* Decorator */: + case 157 /* Decorator */: return emitDecorator(node); // Type members - case 159 /* PropertySignature */: + case 158 /* PropertySignature */: return emitPropertySignature(node); - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 161 /* MethodSignature */: + case 160 /* MethodSignature */: return emitMethodSignature(node); - case 162 /* MethodDeclaration */: + case 161 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 163 /* Constructor */: + case 162 /* Constructor */: return emitConstructor(node); - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return emitAccessorDeclaration(node); - case 166 /* CallSignature */: + case 165 /* CallSignature */: return emitCallSignature(node); - case 167 /* ConstructSignature */: + case 166 /* ConstructSignature */: return emitConstructSignature(node); - case 168 /* IndexSignature */: + case 167 /* IndexSignature */: return emitIndexSignature(node); // Types - case 169 /* TypePredicate */: + case 168 /* TypePredicate */: return emitTypePredicate(node); - case 170 /* TypeReference */: + case 169 /* TypeReference */: return emitTypeReference(node); - case 171 /* FunctionType */: + case 170 /* FunctionType */: return emitFunctionType(node); - case 301 /* JSDocFunctionType */: + case 300 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 172 /* ConstructorType */: + case 171 /* ConstructorType */: return emitConstructorType(node); - case 173 /* TypeQuery */: + case 172 /* TypeQuery */: return emitTypeQuery(node); - case 174 /* TypeLiteral */: + case 173 /* TypeLiteral */: return emitTypeLiteral(node); - case 175 /* ArrayType */: + case 174 /* ArrayType */: return emitArrayType(node); - case 176 /* TupleType */: + case 175 /* TupleType */: return emitTupleType(node); - case 177 /* OptionalType */: + case 176 /* OptionalType */: return emitOptionalType(node); - case 179 /* UnionType */: + case 178 /* UnionType */: return emitUnionType(node); - case 180 /* IntersectionType */: + case 179 /* IntersectionType */: return emitIntersectionType(node); - case 181 /* ConditionalType */: + case 180 /* ConditionalType */: return emitConditionalType(node); - case 182 /* InferType */: + case 181 /* InferType */: return emitInferType(node); - case 183 /* ParenthesizedType */: + case 182 /* ParenthesizedType */: return emitParenthesizedType(node); - case 217 /* ExpressionWithTypeArguments */: + case 216 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 184 /* ThisType */: + case 183 /* ThisType */: return emitThisType(); - case 185 /* TypeOperator */: + case 184 /* TypeOperator */: return emitTypeOperator(node); - case 186 /* IndexedAccessType */: + case 185 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 187 /* MappedType */: + case 186 /* MappedType */: return emitMappedType(node); - case 188 /* LiteralType */: + case 187 /* LiteralType */: return emitLiteralType(node); - case 189 /* ImportType */: + case 188 /* ImportType */: return emitImportTypeNode(node); - case 296 /* JSDocAllType */: + case 295 /* JSDocAllType */: writePunctuation("*"); return; - case 297 /* JSDocUnknownType */: + case 296 /* JSDocUnknownType */: writePunctuation("?"); return; - case 298 /* JSDocNullableType */: + case 297 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 299 /* JSDocNonNullableType */: + case 298 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 300 /* JSDocOptionalType */: + case 299 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 178 /* RestType */: - case 302 /* JSDocVariadicType */: + case 177 /* RestType */: + case 301 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 190 /* ObjectBindingPattern */: + case 189 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 191 /* ArrayBindingPattern */: + case 190 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 192 /* BindingElement */: + case 191 /* BindingElement */: return emitBindingElement(node); // Misc - case 222 /* TemplateSpan */: + case 221 /* TemplateSpan */: return emitTemplateSpan(node); - case 223 /* SemicolonClassElement */: + case 222 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 224 /* Block */: + case 223 /* Block */: return emitBlock(node); - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: return emitVariableStatement(node); - case 225 /* EmptyStatement */: + case 224 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 227 /* ExpressionStatement */: + case 226 /* ExpressionStatement */: return emitExpressionStatement(node); - case 228 /* IfStatement */: + case 227 /* IfStatement */: return emitIfStatement(node); - case 229 /* DoStatement */: + case 228 /* DoStatement */: return emitDoStatement(node); - case 230 /* WhileStatement */: + case 229 /* WhileStatement */: return emitWhileStatement(node); - case 231 /* ForStatement */: + case 230 /* ForStatement */: return emitForStatement(node); - case 232 /* ForInStatement */: + case 231 /* ForInStatement */: return emitForInStatement(node); - case 233 /* ForOfStatement */: + case 232 /* ForOfStatement */: return emitForOfStatement(node); - case 234 /* ContinueStatement */: + case 233 /* ContinueStatement */: return emitContinueStatement(node); - case 235 /* BreakStatement */: + case 234 /* BreakStatement */: return emitBreakStatement(node); - case 236 /* ReturnStatement */: + case 235 /* ReturnStatement */: return emitReturnStatement(node); - case 237 /* WithStatement */: + case 236 /* WithStatement */: return emitWithStatement(node); - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: return emitSwitchStatement(node); - case 239 /* LabeledStatement */: + case 238 /* LabeledStatement */: return emitLabeledStatement(node); - case 240 /* ThrowStatement */: + case 239 /* ThrowStatement */: return emitThrowStatement(node); - case 241 /* TryStatement */: + case 240 /* TryStatement */: return emitTryStatement(node); - case 242 /* DebuggerStatement */: + case 241 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 243 /* VariableDeclaration */: + case 242 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 246 /* ClassDeclaration */: + case 245 /* ClassDeclaration */: return emitClassDeclaration(node); - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 250 /* ModuleDeclaration */: + case 249 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 251 /* ModuleBlock */: + case 250 /* ModuleBlock */: return emitModuleBlock(node); - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: return emitCaseBlock(node); - case 253 /* NamespaceExportDeclaration */: + case 252 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: return emitImportDeclaration(node); - case 256 /* ImportClause */: + case 255 /* ImportClause */: return emitImportClause(node); - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: return emitNamespaceImport(node); - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: return emitNamespaceExport(node); - case 258 /* NamedImports */: + case 257 /* NamedImports */: return emitNamedImports(node); - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: return emitImportSpecifier(node); - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: return emitExportAssignment(node); - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: return emitExportDeclaration(node); - case 262 /* NamedExports */: + case 261 /* NamedExports */: return emitNamedExports(node); - case 264 /* ExportSpecifier */: + case 263 /* ExportSpecifier */: return emitExportSpecifier(node); - case 265 /* MissingDeclaration */: + case 264 /* MissingDeclaration */: return; // Module references - case 266 /* ExternalModuleReference */: + case 265 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 269 /* JsxOpeningElement */: - case 272 /* JsxOpeningFragment */: + case 268 /* JsxOpeningElement */: + case 271 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 270 /* JsxClosingElement */: - case 273 /* JsxClosingFragment */: + case 269 /* JsxClosingElement */: + case 272 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 274 /* JsxAttribute */: + case 273 /* JsxAttribute */: return emitJsxAttribute(node); - case 275 /* JsxAttributes */: + case 274 /* JsxAttributes */: return emitJsxAttributes(node); - case 276 /* JsxSpreadAttribute */: + case 275 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 277 /* JsxExpression */: + case 276 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 278 /* CaseClause */: + case 277 /* CaseClause */: return emitCaseClause(node); - case 279 /* DefaultClause */: + case 278 /* DefaultClause */: return emitDefaultClause(node); - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: return emitHeritageClause(node); - case 281 /* CatchClause */: + case 280 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 282 /* PropertyAssignment */: + case 281 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 283 /* ShorthandPropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 284 /* SpreadAssignment */: + case 283 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 285 /* EnumMember */: + case 284 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 318 /* JSDocParameterTag */: - case 324 /* JSDocPropertyTag */: + case 317 /* JSDocParameterTag */: + case 323 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 319 /* JSDocReturnTag */: - case 321 /* JSDocTypeTag */: - case 320 /* JSDocThisTag */: - case 317 /* JSDocEnumTag */: + case 318 /* JSDocReturnTag */: + case 320 /* JSDocTypeTag */: + case 319 /* JSDocThisTag */: + case 316 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 309 /* JSDocImplementsTag */: - case 308 /* JSDocAugmentsTag */: + case 308 /* JSDocImplementsTag */: + case 307 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 322 /* JSDocTemplateTag */: + case 321 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 323 /* JSDocTypedefTag */: + case 322 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 316 /* JSDocCallbackTag */: + case 315 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 306 /* JSDocSignature */: + case 305 /* JSDocSignature */: return emitJSDocSignature(node); - case 305 /* JSDocTypeLiteral */: + case 304 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 311 /* JSDocClassTag */: - case 307 /* JSDocTag */: + case 310 /* JSDocClassTag */: + case 306 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 304 /* JSDocComment */: + case 303 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -94744,71 +94624,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 193 /* ArrayLiteralExpression */: + case 192 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 194 /* ObjectLiteralExpression */: + case 193 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 195 /* PropertyAccessExpression */: + case 194 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 196 /* ElementAccessExpression */: + case 195 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 197 /* CallExpression */: + case 196 /* CallExpression */: return emitCallExpression(node); - case 198 /* NewExpression */: + case 197 /* NewExpression */: return emitNewExpression(node); - case 199 /* TaggedTemplateExpression */: + case 198 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 201 /* ParenthesizedExpression */: + case 200 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 202 /* FunctionExpression */: + case 201 /* FunctionExpression */: return emitFunctionExpression(node); - case 203 /* ArrowFunction */: + case 202 /* ArrowFunction */: return emitArrowFunction(node); - case 204 /* DeleteExpression */: + case 203 /* DeleteExpression */: return emitDeleteExpression(node); - case 205 /* TypeOfExpression */: + case 204 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 206 /* VoidExpression */: + case 205 /* VoidExpression */: return emitVoidExpression(node); - case 207 /* AwaitExpression */: + case 206 /* AwaitExpression */: return emitAwaitExpression(node); - case 208 /* PrefixUnaryExpression */: + case 207 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 209 /* PostfixUnaryExpression */: + case 208 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 210 /* BinaryExpression */: + case 209 /* BinaryExpression */: return emitBinaryExpression(node); - case 211 /* ConditionalExpression */: + case 210 /* ConditionalExpression */: return emitConditionalExpression(node); - case 212 /* TemplateExpression */: + case 211 /* TemplateExpression */: return emitTemplateExpression(node); - case 213 /* YieldExpression */: + case 212 /* YieldExpression */: return emitYieldExpression(node); - case 214 /* SpreadElement */: + case 213 /* SpreadElement */: return emitSpreadExpression(node); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return emitClassExpression(node); - case 216 /* OmittedExpression */: + case 215 /* OmittedExpression */: return; - case 218 /* AsExpression */: + case 217 /* AsExpression */: return emitAsExpression(node); - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: return emitNonNullExpression(node); - case 220 /* MetaProperty */: + case 219 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 267 /* JsxElement */: + case 266 /* JsxElement */: return emitJsxElement(node); - case 268 /* JsxSelfClosingElement */: + case 267 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 271 /* JsxFragment */: + case 270 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 327 /* PartiallyEmittedExpression */: + case 326 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 328 /* CommaListExpression */: + case 327 /* CommaListExpression */: return emitCommaList(node); } } @@ -94850,7 +94730,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 292 /* Bundle */ ? node : undefined; + var bundle = node.kind === 291 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -94950,7 +94830,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 288 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 287 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -95023,7 +94903,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 301 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 300 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -95085,7 +94965,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 164 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 163 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -95268,7 +95148,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 139 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 138 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -95502,7 +95382,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 208 /* PrefixUnaryExpression */ + return operand.kind === 207 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -95690,7 +95570,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node); emitTokenWithComment(87 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 228 /* IfStatement */) { + if (node.elseStatement.kind === 227 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -95753,7 +95633,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(153 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(152 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -95761,7 +95641,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { emit(node); } else { @@ -96057,7 +95937,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 250 /* ModuleDeclaration */) { + while (body.kind === 249 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -96102,7 +95982,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(150 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -96110,7 +95990,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(146 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(145 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -96150,7 +96030,7 @@ var ts; var nextPos = emitTokenWithComment(89 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(146 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(145 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -96162,7 +96042,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(150 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(149 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -96173,7 +96053,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(123 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(137 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(136 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -96393,7 +96273,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 321 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 320 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -96427,7 +96307,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 295 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 294 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -96446,7 +96326,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 305 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 304 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -97266,7 +97146,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 201 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 200 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -97331,84 +97211,84 @@ var ts; if (!node) return; switch (node.kind) { - case 224 /* Block */: + case 223 /* Block */: ts.forEach(node.statements, generateNames); break; - case 239 /* LabeledStatement */: - case 237 /* WithStatement */: - case 229 /* DoStatement */: - case 230 /* WhileStatement */: + case 238 /* LabeledStatement */: + case 236 /* WithStatement */: + case 228 /* DoStatement */: + case 229 /* WhileStatement */: generateNames(node.statement); break; - case 228 /* IfStatement */: + case 227 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 231 /* ForStatement */: - case 233 /* ForOfStatement */: - case 232 /* ForInStatement */: + case 230 /* ForStatement */: + case 232 /* ForOfStatement */: + case 231 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 238 /* SwitchStatement */: + case 237 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 252 /* CaseBlock */: + case 251 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 278 /* CaseClause */: - case 279 /* DefaultClause */: + case 277 /* CaseClause */: + case 278 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 241 /* TryStatement */: + case 240 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 281 /* CatchClause */: + case 280 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: generateNames(node.declarationList); break; - case 244 /* VariableDeclarationList */: + case 243 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 243 /* VariableDeclaration */: - case 157 /* Parameter */: - case 192 /* BindingElement */: - case 246 /* ClassDeclaration */: + case 242 /* VariableDeclaration */: + case 156 /* Parameter */: + case 191 /* BindingElement */: + case 245 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 245 /* FunctionDeclaration */: + case 244 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 190 /* ObjectBindingPattern */: - case 191 /* ArrayBindingPattern */: + case 189 /* ObjectBindingPattern */: + case 190 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 255 /* ImportDeclaration */: + case 254 /* ImportDeclaration */: generateNames(node.importClause); break; - case 256 /* ImportClause */: + case 255 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 257 /* NamespaceImport */: + case 256 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 263 /* NamespaceExport */: + case 262 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 258 /* NamedImports */: + case 257 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 259 /* ImportSpecifier */: + case 258 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -97417,12 +97297,12 @@ var ts; if (!node) return; switch (node.kind) { - case 282 /* PropertyAssignment */: - case 283 /* ShorthandPropertyAssignment */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 281 /* PropertyAssignment */: + case 282 /* ShorthandPropertyAssignment */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -97604,23 +97484,23 @@ var ts; switch (node.kind) { case 75 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 250 /* ModuleDeclaration */: - case 249 /* EnumDeclaration */: + case 249 /* ModuleDeclaration */: + case 248 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 255 /* ImportDeclaration */: - case 261 /* ExportDeclaration */: + case 254 /* ImportDeclaration */: + case 260 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 245 /* FunctionDeclaration */: - case 246 /* ClassDeclaration */: - case 260 /* ExportAssignment */: + case 244 /* FunctionDeclaration */: + case 245 /* ClassDeclaration */: + case 259 /* ExportAssignment */: return generateNameForExportDefault(); - case 215 /* ClassExpression */: + case 214 /* ClassExpression */: return generateNameForClassExpression(); - case 162 /* MethodDeclaration */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: + case 161 /* MethodDeclaration */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 155 /* ComputedPropertyName */: + case 154 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -97668,7 +97548,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 326 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 325 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -97692,7 +97572,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 244 /* VariableDeclarationList */) { + if (node.kind === 243 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -97951,7 +97831,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -97964,7 +97844,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 326 /* NotEmittedStatement */ + if (node.kind !== 325 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -99990,22 +99870,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 157 /* Parameter */: - case 160 /* PropertyDeclaration */: - case 162 /* MethodDeclaration */: + case 156 /* Parameter */: + case 159 /* PropertyDeclaration */: + case 161 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 161 /* MethodSignature */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: - case 243 /* VariableDeclaration */: + case 160 /* MethodSignature */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: + case 242 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -100013,58 +99893,58 @@ var ts; } } switch (node.kind) { - case 256 /* ImportClause */: + case 255 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 261 /* ExportDeclaration */: + case 260 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 254 /* ImportEqualsDeclaration */: + case 253 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 260 /* ExportAssignment */: + case 259 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 280 /* HeritageClause */: + case 279 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 113 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 247 /* InterfaceDeclaration */: + case 246 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(114 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 250 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(137 /* NamespaceKeyword */) : ts.tokenToString(136 /* ModuleKeyword */); + case 249 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(136 /* NamespaceKeyword */) : ts.tokenToString(135 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 248 /* TypeAliasDeclaration */: + case 247 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 249 /* EnumDeclaration */: + case 248 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(88 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 219 /* NonNullExpression */: + case 218 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 218 /* AsExpression */: + case 217 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 200 /* TypeAssertionExpression */: + case 199 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -100073,29 +99953,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 246 /* ClassDeclaration */: - case 215 /* ClassExpression */: - case 162 /* MethodDeclaration */: - case 163 /* Constructor */: - case 164 /* GetAccessor */: - case 165 /* SetAccessor */: - case 202 /* FunctionExpression */: - case 245 /* FunctionDeclaration */: - case 203 /* ArrowFunction */: + case 245 /* ClassDeclaration */: + case 214 /* ClassExpression */: + case 161 /* MethodDeclaration */: + case 162 /* Constructor */: + case 163 /* GetAccessor */: + case 164 /* SetAccessor */: + case 201 /* FunctionExpression */: + case 244 /* FunctionDeclaration */: + case 202 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 226 /* VariableStatement */: + case 225 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 226 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 225 /* VariableStatement */); return "skip"; } break; - case 160 /* PropertyDeclaration */: + case 159 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -100107,19 +99987,19 @@ var ts; return "skip"; } break; - case 157 /* Parameter */: + case 156 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 197 /* CallExpression */: - case 198 /* NewExpression */: - case 217 /* ExpressionWithTypeArguments */: - case 268 /* JsxSelfClosingElement */: - case 269 /* JsxOpeningElement */: - case 199 /* TaggedTemplateExpression */: + case 196 /* CallExpression */: + case 197 /* NewExpression */: + case 216 /* ExpressionWithTypeArguments */: + case 267 /* JsxSelfClosingElement */: + case 268 /* JsxOpeningElement */: + case 198 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -100141,8 +100021,8 @@ var ts; case 119 /* PublicKeyword */: case 117 /* PrivateKeyword */: case 118 /* ProtectedKeyword */: - case 139 /* ReadonlyKeyword */: - case 131 /* DeclareKeyword */: + case 138 /* ReadonlyKeyword */: + case 130 /* DeclareKeyword */: case 122 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); break;